Commit Graph
9 Commits
Author SHA1 Message Date
slahiriandClaude Opus 4.5 290020740d feat: enhanced category system with body/pose detection
Major additions:
- New 10-category classification system (enhanced_categories.py)
  - 2300+ vocabulary terms organized by subcategory
  - Pattern-based fallback classification
  - Filtered terms for booru/anime meta tags

- Expanded CLIP vocabulary (clip_scene.py)
  - breast_size, body_exposure, body_type categories
  - arm_pose, leg_pose, body_pose categories
  - head_pose, gaze_direction, facial_expression

- New taggers:
  - FlorenceParser: Extract pose/body from VLM descriptions
  - DWPoseTagger: Skeleton-based pose detection
  - ExifTagger: Camera/lens metadata extraction
  - clip_body_pose: CLIP zero-shot for body details

- Enhanced vocabulary loader integration
  - Maps enhanced categories to CanonicalCategory
  - Populates SUBJECT_DETAIL_KEYWORDS subcategories

- Fixed classification issues:
  - pool/poolside -> environment (was constraints)
  - tree/palm tree -> environment (was style)
  - saddle brown tones -> style_quality (was subject)
  - Filtered: rei no pool, 3d, mixed media

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 11:42:51 +05:30
slahiriandClaude Opus 4.5 786926982f feat: add scene/landmark/sky taggers, improve wildlife detection, add progress bar
New Taggers:
- LandmarkTagger: 150+ famous landmarks (monuments, natural wonders, bridges)
- SkyWeatherTagger: clouds, sun/moon, weather, celestial elements
- Places365Tagger: scene recognition with 365 categories
- CLIPSceneTagger: photo style, camera type, subject, mood
- WildlifeTagger: animals, pets, nature, biomes

Scene Detection Improvements:
- Fixed "no humans" tag override for human detection
- Fixed scene type detection for animal/wildlife photos
- Wildlife/landscape taggers now skip for portrait/fashion scenes
- Canonical structurer respects "no humans" + "animal" tags

Analysis Node Improvements:
- Added analysis_enabled toggle (skip taggers for quick caption)
- Added prompt output (florence_description)
- Progress bar now starts during taggers phase
- Progress callback passed through pipeline

Bug Fixes:
- Fixed abstract method error in Places365/CLIPScene/Wildlife taggers
- Added load() method to new CLIP-based taggers

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 03:48:10 +05:30
slahiriandClaude Opus 4.5 9f6f30805b feat: Z-Image prompt pipeline redesign (WIP)
Changes:
- Add Z-Image prompt style with 6-part formula support
- Add vocabulary enhancement system (984 terms)
- Add classification improvements (age, clothing, subject count)
- Add Full and Z-Image prompt styles preserving Florence prose
- Add pipeline design document (docs/COMPOSE_PIPELINE_DESIGN.md)
- Remove RAG system (not working well)
- Remove use_rag input from compose node

Key insight: Pipeline should PRESERVE information, not destroy it.
- Florence descriptions kept intact (not tokenized)
- Tags organized into Z-Image categories
- NLP mode = structured output
- LLM mode = natural prose generation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 23:30:13 +05:30
slahiriandClaude Opus 4.5 e0b2f000b6 fix: improve classification accuracy and conflict resolution
Classification fixes:
- Add afro/african hairstyles, beard, facial hair to HAIR subcategory
- Add "rule of thirds" to photography composition patterns
- Filter long caption sentences (max 12 words)

Conflict resolution:
- Add gender conflict filtering (male vs female tags)
- Add ethnicity conflict resolution (asian vs african/dark-skinned)
- Add body shot mutual exclusivity (full body vs upper body)
- Add age conflict resolution (boy vs mature male)

False positive filtering:
- Higher confidence thresholds for fashion_segformer (0.6+)
- Filter common fashion false positives (glasses, headwear, shoes)
- Add META patterns for caption sentence starters
- Filter generic tags (general, original, fantasy, suggestive content)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:40:46 +05:30
slahiriandClaude Opus 4.5 6d57304db0 feat: add pose extraction and expand ethnicity keywords
Pose extraction:
- Add TokenSource.POSE with 0.95 reliability weight
- Add extract_from_pose() to tokenizer
- Route pose tokens to ACTION_POSE category via source-based routing
- Pose tags like "standing", "arms at sides", "facing viewer" now captured

Ethnicity expansion:
- Add 80+ ethnicity terms to SKIN subcategory
- Includes: South Asian (south indian, desi, punjabi, etc.)
- East Asian (japanese, korean, chinese, vietnamese, etc.)
- Middle Eastern (arab, persian, turkish, etc.)
- African (nigerian, ethiopian, etc.)
- Latin American (brazilian, mexican, etc.)
- Mixed/multiracial terms

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 19:49:50 +05:30
slahiriandClaude Opus 4.5 bb6a31bab6 fix: improve prompt accuracy with conflict resolution and token balancing
- Add mutually exclusive groups for contradictory tags (hair texture,
  eye color, body type, skin tone, positions, facing direction)
- Filter generic Western clothing when ethnic wear (saree, kimono, etc.) detected
- Add category-specific token limits to prevent overwhelming:
  - subject_details: 25 (was using default 50)
  - environment: 15, lighting: 12 (important for scene recreation)
- Prioritize short tags (<30 chars) over long sentences in subject_details
  (80% short tags, 20% long sentences for better image generation)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 19:42:56 +05:30
slahiriandClaude Opus 4.5 da21ad1806 feat(compose): add hybrid classifier with embeddings and LLM layers
Extends the classification pipeline with semantic and AI-powered layers:
- Layer 4: Embedding similarity using sentence-transformers (optional)
- Layer 4.5: LLM classification fallback (local/Anthropic/OpenAI/Gemini)
- Expanded dictionary keywords for 100% processed rate
- ClassifierConfig for configuring hybrid pipeline behavior

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 11:07:16 +05:30
slahiriandClaude Opus 4.5 574b976728 feat(compose): implement Phase 3 - Classification
Classification pipeline with 5-layer cascade:
- Layer 1: Florence analyze key mapping
- Layer 2: Source-based routing (photography, IQA, composition)
- Layer 3: Dictionary keyword matching with multi-category support
- Layer 5: Uncategorized fallback

Key features:
- Expanded keyword dictionaries for 90%+ classification rate
- Conflict resolution for mutually exclusive tokens
- Subject detail subcategories (hair, eyes, face, body, clothing, skin)
- Multi-category tokens (e.g., "looking at viewer" → action + eyes)

Test results: Calvin Klein 90.8%, Saree 84.0%, Cupcake 83.9%, Landscape 77.8%

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 10:27:32 +05:30
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