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ra Supreme Flux Optimizer
|
3 |
+
"""
|
4 |
+
|
5 |
+
# Forbidden elements to filter out from CLIP results
|
6 |
+
FORBIDDEN_ELEMENTS = ["++", "weights", "white background [en dev]"]
|
7 |
+
|
8 |
+
# Age indicators for demographic analysis
|
9 |
+
MICRO_AGE_INDICATORS = {
|
10 |
+
"infant": ["baby", "infant", "newborn", "toddler"],
|
11 |
+
"child": ["child", "kid", "young", "little", "small", "youth"],
|
12 |
+
"teen": ["teenager", "teen", "adolescent", "young adult", "student"],
|
13 |
+
"young_adult": ["young adult", "twenties", "thirty", "youthful", "fresh"],
|
14 |
+
"middle_aged": ["middle-aged", "forties", "fifties", "mature", "experienced"],
|
15 |
+
"senior": ["senior", "older", "elderly", "aged", "vintage", "seasoned"],
|
16 |
+
"elderly": ["elderly", "old", "ancient", "weathered", "aged", "gray", "grey",
|
17 |
+
"white hair", "silver", "wrinkled", "lined", "creased", "time-worn",
|
18 |
+
"distinguished by age"]
|
19 |
+
}
|
20 |
+
|
21 |
+
# Facial feature analysis categories
|
22 |
+
ULTRA_FACIAL_ANALYSIS = {
|
23 |
+
"eye_features": {
|
24 |
+
"shape": ["round eyes", "almond eyes", "narrow eyes", "wide eyes",
|
25 |
+
"deep-set eyes", "prominent eyes"],
|
26 |
+
"expression": ["intense gaze", "piercing stare", "gentle eyes", "wise eyes",
|
27 |
+
"tired eyes", "alert eyes", "contemplative stare", "focused gaze",
|
28 |
+
"distant look"],
|
29 |
+
"color": ["brown eyes", "blue eyes", "green eyes", "hazel eyes",
|
30 |
+
"dark eyes", "light eyes"],
|
31 |
+
"condition": ["clear eyes", "bloodshot", "bright eyes", "dull eyes",
|
32 |
+
"sparkling eyes"]
|
33 |
+
},
|
34 |
+
"eyebrow_analysis": ["thick eyebrows", "thin eyebrows", "bushy eyebrows",
|
35 |
+
"arched eyebrows", "straight eyebrows", "gray eyebrows"],
|
36 |
+
"nose_features": ["prominent nose", "straight nose", "aquiline nose",
|
37 |
+
"small nose", "wide nose", "narrow nose"],
|
38 |
+
"mouth_expression": {
|
39 |
+
"shape": ["thin lips", "full lips", "small mouth", "wide mouth"],
|
40 |
+
"expression": ["slight smile", "serious expression", "frown",
|
41 |
+
"neutral expression", "contemplative look", "stern look",
|
42 |
+
"gentle expression"]
|
43 |
+
},
|
44 |
+
"facial_hair_ultra": {
|
45 |
+
"beard_types": ["full beard", "goatee", "mustache", "stubble",
|
46 |
+
"clean-shaven", "five o'clock shadow"],
|
47 |
+
"beard_texture": ["thick beard", "thin beard", "coarse beard",
|
48 |
+
"fine beard", "well-groomed beard", "unkempt beard"],
|
49 |
+
"beard_color": ["black beard", "brown beard", "gray beard", "grey beard",
|
50 |
+
"silver beard", "white beard", "salt-and-pepper beard",
|
51 |
+
"graying beard"],
|
52 |
+
"beard_length": ["long beard", "short beard", "trimmed beard",
|
53 |
+
"full-length beard"]
|
54 |
+
},
|
55 |
+
"skin_analysis": ["smooth skin", "weathered skin", "wrinkled skin",
|
56 |
+
"clear skin", "rough skin", "aged skin", "youthful skin",
|
57 |
+
"tanned skin", "pale skin", "olive skin"],
|
58 |
+
"facial_structure": ["angular face", "round face", "oval face", "square jaw",
|
59 |
+
"defined cheekbones", "high cheekbones", "strong jawline",
|
60 |
+
"soft features", "sharp features"]
|
61 |
+
}
|
62 |
+
|
63 |
+
# Emotion and expression categories
|
64 |
+
EMOTION_MICRO_EXPRESSIONS = {
|
65 |
+
"primary_emotions": ["happy", "sad", "angry", "fearful", "surprised",
|
66 |
+
"disgusted", "contemptuous"],
|
67 |
+
"complex_emotions": ["contemplative", "melancholic", "serene", "intense",
|
68 |
+
"peaceful", "troubled", "confident", "uncertain", "wise",
|
69 |
+
"stern", "gentle", "authoritative"],
|
70 |
+
"emotional_indicators": ["furrowed brow", "raised eyebrows", "squinted eyes",
|
71 |
+
"pursed lips", "relaxed expression", "tense jaw",
|
72 |
+
"soft eyes", "hard stare"]
|
73 |
+
}
|
74 |
+
|
75 |
+
# Cultural and religious indicators
|
76 |
+
CULTURAL_RELIGIOUS_ULTRA = {
|
77 |
+
"jewish_orthodox": ["Orthodox Jewish", "Hasidic", "Ultra-Orthodox",
|
78 |
+
"religious Jewish", "traditional Jewish", "devout Jewish"],
|
79 |
+
"christian": ["Christian", "Catholic", "Protestant", "Orthodox Christian",
|
80 |
+
"religious Christian"],
|
81 |
+
"muslim": ["Muslim", "Islamic", "religious Muslim", "devout Muslim"],
|
82 |
+
"buddhist": ["Buddhist", "monk", "religious Buddhist"],
|
83 |
+
"general_religious": ["religious", "devout", "pious", "spiritual",
|
84 |
+
"faithful", "observant"],
|
85 |
+
"traditional_clothing": {
|
86 |
+
"jewish": ["yarmulke", "kippah", "tallit", "tzitzit", "black hat",
|
87 |
+
"Orthodox hat", "religious hat", "traditional Jewish hat"],
|
88 |
+
"general": ["religious garment", "traditional clothing",
|
89 |
+
"ceremonial dress", "formal religious attire"]
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
# Clothing and accessories categories
|
94 |
+
CLOTHING_ACCESSORIES_ULTRA = {
|
95 |
+
"headwear": ["hat", "cap", "beret", "headband", "turban", "hood",
|
96 |
+
"helmet", "crown", "headpiece"],
|
97 |
+
"eyewear": ["glasses", "spectacles", "sunglasses", "reading glasses",
|
98 |
+
"wire-frame glasses", "thick-rimmed glasses", "designer glasses",
|
99 |
+
"vintage glasses"],
|
100 |
+
"clothing_types": ["suit", "jacket", "shirt", "dress", "robe", "uniform",
|
101 |
+
"casual wear", "formal wear", "business attire"],
|
102 |
+
"clothing_styles": ["formal", "casual", "business", "traditional",
|
103 |
+
"modern", "vintage", "classic", "contemporary"],
|
104 |
+
"accessories": ["jewelry", "watch", "necklace", "ring", "bracelet",
|
105 |
+
"earrings", "pin", "brooch"]
|
106 |
+
}
|
107 |
+
|
108 |
+
# Environmental analysis categories
|
109 |
+
ENVIRONMENTAL_ULTRA_ANALYSIS = {
|
110 |
+
"indoor_settings": {
|
111 |
+
"residential": ["home", "house", "apartment", "living room", "bedroom",
|
112 |
+
"kitchen", "dining room"],
|
113 |
+
"office": ["office", "workplace", "conference room", "meeting room",
|
114 |
+
"boardroom", "desk"],
|
115 |
+
"institutional": ["school", "hospital", "government building", "court",
|
116 |
+
"library"],
|
117 |
+
"religious": ["church", "synagogue", "mosque", "temple", "chapel",
|
118 |
+
"sanctuary"],
|
119 |
+
"commercial": ["store", "restaurant", "hotel", "mall", "shop"]
|
120 |
+
},
|
121 |
+
"outdoor_settings": {
|
122 |
+
"natural": ["park", "garden", "forest", "beach", "mountain",
|
123 |
+
"countryside", "field"],
|
124 |
+
"urban": ["street", "city", "downtown", "plaza", "square", "avenue"],
|
125 |
+
"architectural": ["building", "monument", "bridge", "structure"]
|
126 |
+
},
|
127 |
+
"lighting_ultra": {
|
128 |
+
"natural_light": ["sunlight", "daylight", "morning light", "afternoon light",
|
129 |
+
"evening light", "golden hour", "blue hour", "overcast light",
|
130 |
+
"window light"],
|
131 |
+
"artificial_light": ["indoor lighting", "electric light", "lamp light",
|
132 |
+
"overhead lighting", "side lighting", "fluorescent",
|
133 |
+
"LED lighting"],
|
134 |
+
"dramatic_lighting": ["high contrast", "low key", "high key", "chiaroscuro",
|
135 |
+
"dramatic shadows", "rim lighting", "backlighting",
|
136 |
+
"spotlight"],
|
137 |
+
"quality": ["soft lighting", "hard lighting", "diffused light",
|
138 |
+
"direct light", "ambient light", "mood lighting"]
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
# Pose and body language categories
|
143 |
+
POSE_BODY_LANGUAGE_ULTRA = {
|
144 |
+
"head_position": ["head up", "head down", "head tilted", "head straight",
|
145 |
+
"head turned", "profile view", "three-quarter view"],
|
146 |
+
"posture": ["upright posture", "slouched", "relaxed posture",
|
147 |
+
"formal posture", "casual stance", "dignified bearing"],
|
148 |
+
"hand_positions": ["hands clasped", "hands folded", "hands visible",
|
149 |
+
"hands hidden", "gesturing", "pointing"],
|
150 |
+
"sitting_positions": ["sitting upright", "leaning forward", "leaning back",
|
151 |
+
"sitting casually", "formal sitting"],
|
152 |
+
"eye_contact": ["looking at camera", "looking away", "direct gaze",
|
153 |
+
"averted gaze", "looking down", "looking up"],
|
154 |
+
"overall_demeanor": ["confident", "reserved", "approachable",
|
155 |
+
"authoritative", "gentle", "stern", "relaxed", "tense"]
|
156 |
+
}
|
157 |
+
|
158 |
+
# Photography composition categories
|
159 |
+
COMPOSITION_PHOTOGRAPHY_ULTRA = {
|
160 |
+
"shot_types": ["close-up", "medium shot", "wide shot", "extreme close-up",
|
161 |
+
"portrait shot", "headshot", "bust shot", "full body"],
|
162 |
+
"angles": ["eye level", "high angle", "low angle", "bird's eye",
|
163 |
+
"worm's eye", "Dutch angle"],
|
164 |
+
"framing": ["centered", "off-center", "rule of thirds", "tight framing",
|
165 |
+
"loose framing"],
|
166 |
+
"depth_of_field": ["shallow depth", "deep focus", "bokeh", "sharp focus",
|
167 |
+
"soft focus"],
|
168 |
+
"camera_movement": ["static", "handheld", "stabilized", "smooth"]
|
169 |
+
}
|
170 |
+
|
171 |
+
# Technical photography specifications
|
172 |
+
TECHNICAL_PHOTOGRAPHY_ULTRA = {
|
173 |
+
"camera_systems": {
|
174 |
+
"professional": ["Phase One XF", "Phase One XT", "Hasselblad X2D",
|
175 |
+
"Fujifilm GFX", "Canon EOS R5", "Nikon Z9"],
|
176 |
+
"medium_format": ["Phase One", "Hasselblad", "Fujifilm GFX", "Pentax 645"],
|
177 |
+
"full_frame": ["Canon EOS R", "Nikon Z", "Sony A7", "Leica SL"]
|
178 |
+
},
|
179 |
+
"lenses_ultra": {
|
180 |
+
"portrait": ["85mm f/1.4", "135mm f/2", "105mm f/1.4", "200mm f/2.8"],
|
181 |
+
"standard": ["50mm f/1.4", "35mm f/1.4", "24-70mm f/2.8"],
|
182 |
+
"wide": ["24mm f/1.4", "16-35mm f/2.8", "14mm f/2.8"]
|
183 |
+
},
|
184 |
+
"aperture_settings": ["f/1.4", "f/2", "f/2.8", "f/4", "f/5.6", "f/8"],
|
185 |
+
"photography_styles": ["portrait photography", "documentary photography",
|
186 |
+
"fine art photography", "commercial photography",
|
187 |
+
"editorial photography"]
|
188 |
+
}
|
189 |
+
|
190 |
+
# Quality descriptors based on context
|
191 |
+
QUALITY_DESCRIPTORS_ULTRA = {
|
192 |
+
"based_on_age": {
|
193 |
+
"elderly": ["distinguished", "venerable", "dignified", "wise",
|
194 |
+
"experienced", "seasoned", "time-honored", "revered",
|
195 |
+
"weathered", "sage-like"],
|
196 |
+
"middle_aged": ["professional", "accomplished", "established",
|
197 |
+
"confident", "mature", "refined", "sophisticated"],
|
198 |
+
"young_adult": ["vibrant", "energetic", "fresh", "youthful",
|
199 |
+
"dynamic", "spirited", "lively"]
|
200 |
+
},
|
201 |
+
"based_on_emotion": {
|
202 |
+
"contemplative": ["thoughtful", "reflective", "meditative", "introspective"],
|
203 |
+
"confident": ["assured", "self-possessed", "commanding", "authoritative"],
|
204 |
+
"gentle": ["kind", "warm", "compassionate", "tender"],
|
205 |
+
"stern": ["serious", "grave", "solemn", "austere"]
|
206 |
+
},
|
207 |
+
"based_on_setting": {
|
208 |
+
"formal": ["professional", "official", "ceremonial", "dignified"],
|
209 |
+
"casual": ["relaxed", "informal", "comfortable", "natural"],
|
210 |
+
"artistic": ["creative", "expressive", "aesthetic", "artistic"]
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
# Gender indicators for analysis
|
215 |
+
GENDER_INDICATORS = {
|
216 |
+
"male": ["man", "male", "gentleman", "guy", "he", "his", "masculine"],
|
217 |
+
"female": ["woman", "female", "lady", "she", "her", "feminine"]
|
218 |
+
}
|
219 |
+
|
220 |
+
# Score thresholds and grading
|
221 |
+
SCORE_GRADES = {
|
222 |
+
95: {"grade": "LEGENDARY", "color": "#059669"},
|
223 |
+
90: {"grade": "EXCELLENT", "color": "#10b981"},
|
224 |
+
80: {"grade": "VERY GOOD", "color": "#22c55e"},
|
225 |
+
70: {"grade": "GOOD", "color": "#f59e0b"},
|
226 |
+
60: {"grade": "FAIR", "color": "#f97316"},
|
227 |
+
0: {"grade": "NEEDS WORK", "color": "#ef4444"}
|
228 |
+
}
|