Files
slahiriandClaude Opus 4.5 c7859cf9f4 feat(compose): implement Phase 1 - Core Infrastructure
New data structures for tokenization pipeline:

tokenizer/base.py:
- ImageToken: unified token format (text, confidence, source, type)
- TokenType enum: TAG, PHRASE, KEY_VALUE, SENTENCE
- TokenSource enum: WD14, JOYTAG, PIXAI, FLORENCE_*, etc.
- TokenBatch: collection with filtering methods
- SOURCE_WEIGHTS: reliability weighting per source

classifier/categories.py:
- CanonicalCategory enum: 9 categories + UNCATEGORIZED, FILTERED_META
- SubjectDetailType enum: hair, eyes, face, body, clothing, skin, accessories
- CategoryKeywords: exact/prefix/suffix/contains pattern matching
- Keyword dictionaries for all categories
- META_FILTER_PATTERNS: patterns to filter out
- FLORENCE_KEY_TO_CATEGORY: key routing for florence_analyze

classifier/base.py:
- TokenClassification: classification result with primary/secondary categories
- ClassifiedImage: organized tokens by category for assembly

Tests:
- test_phase1_infrastructure.py: 21 unit tests (all passing)
- test_real_image.py: real metadata token extraction demo
- sample_metadata*.json: real image metadata samples

All 21 tests pass. Ready for Phase 2: Tokenization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 09:51:09 +05:30

199 lines
5.9 KiB
JSON

{
"image_info": {
"width": 288,
"height": 512
},
"wd14": {
"1girl": 0.999,
"solo": 0.978,
"realistic": 0.975,
"underwear": 0.953,
"navel": 0.924,
"brown hair": 0.915,
"panties": 0.904,
"long hair": 0.9,
"breasts": 0.879,
"brown eyes": 0.87,
"sports bra": 0.868,
"white sports bra": 0.866,
"underwear only": 0.822,
"sensitive": 0.79
},
"pixai": {
"1girl": 0.971,
"realistic": 0.952,
"solo": 0.942,
"navel": 0.933,
"sports bra": 0.921,
"panties": 0.899,
"underwear": 0.889,
"long hair": 0.852,
"breasts": 0.831,
"white sports bra": 0.824,
"white panties": 0.781,
"looking at viewer": 0.765,
"underwear only": 0.759,
"lips": 0.75,
"cleavage": 0.743,
"brown hair": 0.654,
"cowboy shot": 0.654,
"simple background": 0.649,
"brown eyes": 0.648,
"asian": 0.603,
"3d": 0.601,
"white bra": 0.596,
"thigh gap": 0.592,
"standing": 0.581,
"training bra": 0.518,
"photorealistic": 0.516,
"bra": 0.483,
"grey background": 0.474,
"arms at sides": 0.425,
"stomach": 0.422,
"nose": 0.409,
"collarbone": 0.408,
"thick lips": 0.394,
"medium breasts": 0.37,
"wavy hair": 0.365,
"large breasts": 0.338,
"curly hair": 0.303
},
"joytag": {
"1girl": 0.96,
"solo": 0.901,
"underwear": 0.869,
"navel": 0.797,
"panties": 0.764,
"breasts": 0.763,
"long hair": 0.743,
"brown hair": 0.741,
"lips": 0.715,
"underwear only": 0.714,
"bra": 0.659,
"photo (medium)": 0.657,
"brown eyes": 0.654,
"standing": 0.642,
"wavy hair": 0.633,
"looking at viewer": 0.615,
"arms at sides": 0.61,
"makeup": 0.605,
"grey background": 0.594,
"stomach": 0.584,
"sports bra": 0.558,
"cowboy shot": 0.558,
"nose": 0.542,
"simple background": 0.539,
"collarbone": 0.537,
"white panties": 0.529,
"medium breasts": 0.528,
"parted lips": 0.521,
"white bra": 0.514,
"bare shoulders": 0.51,
"cleavage": 0.492,
"lipstick": 0.481,
"large breasts": 0.474,
"thighs": 0.444,
"teeth": 0.442,
"clothes writing": 0.441,
"bare arms": 0.437,
"eyeshadow": 0.417,
"curvy": 0.4,
"lingerie": 0.395,
"toned": 0.38,
"wide hips": 0.379,
"pink lips": 0.362,
"curly hair": 0.359,
"eyeliner": 0.351,
"real life": 0.348,
"abs": 0.348,
"midriff": 0.344,
"tan": 0.34,
"jpeg artifacts": 0.325
},
"nudenet": {
"nsfw content": 0.9,
"female face": 0.845,
"exposed belly": 0.825,
"covered female breast (x2)": 0.813,
"covered female genitalia": 0.666,
"exposed armpits": 0.44
},
"photography": {
"light gray tones": 0.9,
"neutral tones": 0.8,
"muted colors": 0.85,
"desaturated": 0.8,
"high key": 0.8,
"bright": 0.75,
"low contrast": 0.8,
"sharp": 0.9,
"in focus": 0.85,
"detailed": 0.8,
"portrait orientation": 0.95,
"vertical frame": 0.9,
"2:3 aspect ratio": 0.85,
"low resolution": 0.8,
"rule of thirds": 0.6,
"photographic framing": 0.8,
"photograph": 0.95,
"photography": 0.9
},
"iqa": {
"good aesthetic quality": 0.8,
"excellent technical quality": 0.9,
"professional quality": 0.85,
"sharp and clean": 0.9,
"excellent clarity": 0.85
},
"composition": {
"vertical lines": 0.7,
"strong linear elements": 0.75,
"partial symmetry": 0.7,
"elements at thirds": 0.75
},
"saliency": {
"subject on horizontal third": 0.75,
"centered subject": 0.85,
"central composition": 0.8,
"subject at golden ratio": 0.75
},
"fashion_yolov8": {
"wearing clothing": 0.783
},
"fashion_yolos": {
"wearing t-shirt": 0.904,
"wearing dress": 0.436,
"wearing shorts": 0.422
},
"fashion_segformer": {
"upper clothing visible": 0.699,
"wearing pants": 0.571
},
"florence_caption": "Photo of a young woman with long, wavy brown hair, wearing a white Calvin Klein crop top and matching panties. She has a fair complexion and is standing confidently with her hands on her hips. The background is plain and light grey, and the lighting is soft and even. The image has a minimalist aesthetic with clean lines and a minimalistic design. The woman is looking directly at the camera with a neutral expression. The text \"Calvin Klein\" is written in black on the front of the crop top.",
"florence_description": "A photo-realistic shoot from a front camera angle about a model in a white Calvin Klein crop top and matching briefs, photographed against a plain light grey background. a woman standing in the middle of the image, with a neutral expression, looking directly at the camera. she has long, wavy brown hair and is wearing a white crop top with the Calvin Klein logo on the front, paired with matching white briefs. the woman has a slim, toned physique and is standing with her arms at her sides, showcasing her toned stomach and midriff. her brown eyes are looking directly into the camera, and her lips are painted a soft pink color. her body is slim and toned, with large breasts and a small waist. the image has a minimalistic, professional look with a focus on the woman's curves and the white background.",
"florence_analyze": {
"camera_angle": "portrait",
"art_style": "photo realistic",
"location": "indoor",
"background": "plain light grey background",
"text": "NA",
"distance_to_camera": "full body",
"clothing": "white crop top",
"image_composition": "middle",
"pants": "white briefs with black trim",
"accessory": "NA",
"shoes": "NA",
"action": "standing",
"facing_direction": "facing viewer",
"eye_direction": "looking at viewer",
"facial_expression": "neutral",
"ear": "NA",
"eye_color": "brown eyes",
"gender": "1 woman",
"hair_color": "dark brown hair",
"hair_style": "long wavy hair",
"race": "light skin",
"body": "slim, toned"
}
}