Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev(narugo): add attachment code for taggers #152

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

narugo1992
Copy link
Contributor

@narugo1992 narugo1992 commented Mar 6, 2025

from pprint import pprint

from imgutils.tagging import get_wd14_tags

image_file = 'test/testfile/nude_girl.png'

pprint(get_wd14_tags(
    image_file,
    fmt=('tag', 'monochrome/scores'),
    attachments={'monochrome': ('deepghs/eattach_monochrome_experiments', 'mlp_layer1_seed1')},
))

expected output is like

({'1girl': 0.9993373155593872,
  'armpits': 0.9639392495155334,
  'arms_behind_head': 0.5415617227554321,
  'arms_up': 0.9117616415023804,
  'blush': 0.9104846715927124,
  'breasts': 0.9896668195724487,
  'breasts_apart': 0.3574076294898987,
  'clitoris': 0.44502294063568115,
  'closed_mouth': 0.7593026161193848,
  'completely_nude': 0.8872355222702026,
  'demon_horns': 0.5313447117805481,
  'hair_between_eyes': 0.4308745265007019,
  'hair_intakes': 0.49763745069503784,
  'horns': 0.9886922836303711,
  'long_hair': 0.9677416086196899,
  'looking_at_viewer': 0.9188930988311768,
  'lying': 0.6900572776794434,
  'medium_breasts': 0.6663060784339905,
  'navel': 0.9513114094734192,
  'nipples': 0.9911118149757385,
  'nude': 0.9724845886230469,
  'on_back': 0.5197966694831848,
  'on_bed': 0.7741402387619019,
  'pillow': 0.7360897064208984,
  'purple_eyes': 0.9750031232833862,
  'pussy': 0.9820599555969238,
  'pussy_juice': 0.8235344886779785,
  'red_hair': 0.970306396484375,
  'smile': 0.5376632809638977,
  'solo': 0.9911975860595703,
  'spread_legs': 0.9256477355957031,
  'stomach': 0.8168476819992065,
  'surtr_(arknights)': 0.995761513710022,
  'sweat': 0.6274305582046509,
  'thighs': 0.5293538570404053,
  'uncensored': 0.9299370646476746,
  'very_long_hair': 0.6630512475967407},
 {'monochrome': 0.014802142977714539, 'normal': 0.9851978421211243})

@narugo1992 narugo1992 added the enhancement New feature or request label Mar 6, 2025
@narugo1992 narugo1992 self-assigned this Mar 6, 2025
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 78.99160% with 25 lines in your changes missing coverage. Please review.

Project coverage is 94.36%. Comparing base (ea23ec1) to head (22519b2).

Files with missing lines Patch % Lines
imgutils/generic/attachment.py 72.72% 24 Missing ⚠️
imgutils/tagging/wd14.py 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
- Coverage   94.75%   94.36%   -0.39%     
==========================================
  Files         124      125       +1     
  Lines        4803     4919     +116     
==========================================
+ Hits         4551     4642      +91     
- Misses        252      277      +25     
Flag Coverage Δ
unittests 94.36% <78.99%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant