narugo commited on
Commit
dd045fa
·
verified ·
1 Parent(s): 4101edd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -9
README.md CHANGED
@@ -18,22 +18,21 @@ ONNX export version of [v2ray/deepgelbooru](https://huggingface.co/v2ray/deepgel
18
  You can use this in [dghs-imgutils](https://github.com/deepghs/imgutils) library, with the following code.
19
 
20
  ```python
21
- from imgutils.tagging import get_deepdanbooru_tags
22
 
23
- rating, features, chars = get_deepdanbooru_tags('skadi.jpg')
24
  print(rating)
25
- # {'rating:safe': 0.9897817969322205, 'rating:questionable': 0.010265916585922241, 'rating:explicit': 5.27501106262207e-05}
26
  print(features)
27
- # {'1girl': 0.9939777851104736, 'bangs': 0.5032391548156738, 'black_border': 0.9943548440933228, 'black_gloves': 0.5011611580848694, 'blue_sky': 0.6877812743186951, 'blush': 0.5543793439865112, 'breasts': 0.8268730044364929, 'cloud': 0.8504312634468079, 'cowboy_shot': 0.6008235216140747, 'crop_top': 0.6635788083076477, 'day': 0.8496971130371094, 'gloves': 0.6107009053230286, 'hair_between_eyes': 0.6682944297790527, 'holding': 0.5619475841522217, 'holding_baseball_bat': 0.5141727328300476, 'letterboxed': 1.0, 'long_hair': 0.9884189367294312, 'looking_at_viewer': 0.5673102140426636, 'midriff': 0.6290558576583862, 'navel': 0.9631234407424927, 'no_hat': 0.7978750467300415, 'no_headwear': 0.7577933073043823, 'outdoors': 0.711855411529541, 'parted_lips': 0.5452844500541687, 'pillarboxed': 0.9841412901878357, 'red_eyes': 0.9587860107421875, 'shirt': 0.6720132231712341, 'short_sleeves': 0.707771360874176, 'silver_hair': 0.6673922538757324, 'sky': 0.8709818124771118, 'solo': 0.9614332914352417, 'sportswear': 0.778618574142456, 'standing': 0.6842772364616394, 'sweat': 0.9076309204101562, 'thighs': 0.580970823764801}
28
  print(chars)
29
- # {'skadi_(arknights)': 0.963334321975708}
30
 
31
- rating, features, chars = get_deepdanbooru_tags('hutao.jpg')
32
  print(rating)
33
- # {'rating:safe': 0.998850405216217, 'rating:questionable': 0.0016517043113708496, 'rating:explicit': 0.00012511014938354492}
34
  print(features)
35
- # {'1girl': 0.9829281568527222, ':p': 0.8942179679870605, 'ahoge': 0.8733786344528198, 'backpack': 0.6322965621948242, 'bag': 0.9987059831619263, 'bag_charm': 0.9754380583763123, 'bangs': 0.6810560822486877, 'black_border': 0.9708783626556396, 'blush': 0.6356005668640137, 'bow': 0.5633739233016968, 'brick_wall': 0.5315946340560913, 'brown_hair': 0.9397273063659668, 'building': 0.9229899644851685, 'charm_(object)': 0.9006360769271851, 'city': 0.9020788669586182, 'cityscape': 0.9547433257102966, 'cowboy_shot': 0.5296419262886047, 'flower': 0.8253411054611206, 'hair_between_eyes': 0.5619837045669556, 'hair_flower': 0.827775776386261, 'hair_ornament': 0.9356369972229004, 'hair_ribbon': 0.5288076996803284, 'jacket': 0.6336134076118469, 'letterboxed': 1.0, 'long_hair': 0.9703260660171509, 'looking_at_viewer': 0.8188957571983337, 'phone_screen': 0.9579575061798096, 'pillarboxed': 0.9954615831375122, 'plaid': 0.9725286364555359, 'plaid_skirt': 0.9638454914093018, 'pleated_skirt': 0.7226817607879639, 'red_eyes': 0.5321246385574341, 'red_nails': 0.5493091344833374, 'school_bag': 0.9863408803939819, 'school_uniform': 0.6794291734695435, 'shirt': 0.5062431693077087, 'shoulder_bag': 0.9325523376464844, 'skirt': 0.9223778247833252, 'skyscraper': 0.7728177905082703, 'sleeves_past_wrists': 0.7257078886032104, 'smile': 0.5357834100723267, 'solo': 0.6939406991004944, 'thighhighs': 0.7054290771484375, 'tongue': 0.9990814924240112, 'tongue_out': 0.9992499351501465, 'twintails': 0.5012531876564026, 'very_long_hair': 0.7461407780647278}
36
  print(chars)
37
  # {}
38
  ```
39
-
 
18
  You can use this in [dghs-imgutils](https://github.com/deepghs/imgutils) library, with the following code.
19
 
20
  ```python
21
+ from imgutils.tagging import get_deepgelbooru_tags
22
 
23
+ rating, features, chars = get_deepgelbooru_tags('skadi.jpg')
24
  print(rating)
25
+ # {'rating:safe': 0.9986732006072998, 'rating:questionable': 0.0013858973979949951, 'rating:explicit': 4.315376281738281e-05}
26
  print(features)
27
+ # {'1girl': 0.9972434639930725, 'baseball': 0.5982598662376404, 'baseball_bat': 0.6429562568664551, 'bike_shorts': 0.36296138167381287, 'black_gloves': 0.8308937549591064, 'black_shirt': 0.7388008832931519, 'blue_sky': 0.6039759516716003, 'blush': 0.30909663438796997, 'breasts': 0.9694308042526245, 'cloud': 0.6422968506813049, 'cowboy_shot': 0.5898381471633911, 'crop_top': 0.8145260810852051, 'day': 0.652222216129303, 'dolphin_shorts': 0.466494083404541, 'gloves': 0.7183809280395508, 'hair_between_eyes': 0.6753682494163513, 'holding': 0.7302790880203247, 'holding_baseball_bat': 0.6649775505065918, 'large_breasts': 0.8446108102798462, 'long_hair': 0.98187655210495, 'looking_at_viewer': 0.8140730857849121, 'midriff': 0.6360533833503723, 'navel': 0.9635934829711914, 'no_hat': 0.33370012044906616, 'no_headwear': 0.44239571690559387, 'outdoors': 0.7891374826431274, 'parted_lips': 0.6471294164657593, 'red_eyes': 0.9958090782165527, 'shirt': 0.8736815452575684, 'short_sleeves': 0.872096061706543, 'shorts': 0.5640895366668701, 'silver_hair': 0.5049663186073303, 'sky': 0.8832778930664062, 'solo': 0.9687467813491821, 'sports_bra': 0.3659853935241699, 'sportswear': 0.9309735298156738, 'standing': 0.49939480423927307, 'stomach': 0.446407288312912, 'sweat': 0.809670090675354, 'thighs': 0.6560589075088501, 'very_long_hair': 0.47956040501594543}
28
  print(chars)
29
+ # {'skadi_(arknights)': 0.9832853674888611}
30
 
31
+ rating, features, chars = get_deepgelbooru_tags('hutao.jpg')
32
  print(rating)
33
+ # {'rating:safe': 0.9994162321090698, 'rating:questionable': 0.0008397102355957031, 'rating:explicit': 0.00035390257835388184}
34
  print(features)
35
+ # {'1girl': 0.9926226139068604, ':p': 0.899387001991272, 'ahoge': 0.34215790033340454, 'backpack': 0.5701972246170044, 'bag': 0.9512913227081299, 'bag_charm': 0.6664570569992065, 'blush': 0.5614628791809082, 'bow': 0.33615976572036743, 'breasts': 0.5770801305770874, 'brown_hair': 0.987317681312561, 'buttons': 0.37286585569381714, 'cardigan': 0.36409223079681396, 'charm_(object)': 0.7329680919647217, 'collared_shirt': 0.5924292206764221, 'cowboy_shot': 0.4344901144504547, 'flower': 0.7465001344680786, 'hair_between_eyes': 0.5225946307182312, 'hair_flower': 0.6976451873779297, 'hair_ornament': 0.9265321493148804, 'hair_ribbon': 0.34527891874313354, 'jacket': 0.6675043106079102, 'long_hair': 0.9096828699111938, 'long_sleeves': 0.41341525316238403, 'looking_at_viewer': 0.8418735265731812, 'miniskirt': 0.3675632178783417, 'nail_polish': 0.5284417867660522, 'open_clothes': 0.30296844244003296, 'outdoors': 0.48789578676223755, 'plaid': 0.36596980690956116, 'plaid_skirt': 0.7759367227554321, 'pleated_skirt': 0.6535028219223022, 'red_eyes': 0.8975257873535156, 'ribbon': 0.36911237239837646, 'school_bag': 0.4171145558357239, 'school_uniform': 0.3942635953426361, 'shirt': 0.6772940754890442, 'skirt': 0.9397937655448914, 'sleeves_past_wrists': 0.5207280516624451, 'smile': 0.4673041105270386, 'solo': 0.9118321537971497, 'tongue': 0.9967410564422607, 'tongue_out': 0.9970728158950806, 'twintails': 0.8419480323791504, 'very_long_hair': 0.6489560604095459, 'white_shirt': 0.6217572689056396}
36
  print(chars)
37
  # {}
38
  ```