dzmu commited on
Commit
2556624
·
verified ·
1 Parent(s): f065cbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -82,25 +82,26 @@ clothing_prompts = [
82
  all_prompts = []
83
  for cat_prompts in style_prompts.values():
84
  all_prompts.extend(cat_prompts)
85
- style_prompts_end_index = len(all_prompts) # Mark where style prompts end
86
  all_prompts.extend(clothing_prompts)
87
  print(f"Total prompts for CLIP: {len(all_prompts)}")
88
 
89
- # Response Templates (Added a more generic 'trash' option)
90
  response_templates = {
91
  'drippy': [
92
  "You're Drippy, bruh – fire {item}!", "{item} goes crazy, on god!", "Certified drippy with that {item}."
93
  ],
94
  'mid': [
95
  "Drop the {item} and you might get a text back.", "It's alright, but I'd upgrade the {item}.",
96
- "Mid fit alert. That {item} is holding you back."
97
  ],
98
  'not_drippy': [
99
  "Bro thought that {item} was tuff!", "Oh hell nah! Burn that {item}!",
100
  "Crimes against fashion, especially that {item}! Also… maybe get a haircut.",
101
  "Never walk out the house again with that {item}.",
102
  "Your drip is trash, try again.", # Generic trash response
103
- "This ain't it chief. The overall style needs work." # Another generic one
 
104
  ]
105
  }
106
  CATEGORY_LABEL_MAP = { "drippy": "drippy", "mid": "mid", "not_drippy": "trash" }
@@ -251,7 +252,7 @@ def analyze_outfit(input_img: Image.Image):
251
  # f"with probability {clip_detected_item_prob:.2f}")
252
  else:
253
  print("I couldn't confidently identify specific clothing items via CLIP.")
254
- clip_detected_item = "fit" # Use a different fallback if CLIP fails
255
  clip_detected_item_prob = 0.0 # Ensure prob is defined
256
 
257
  except Exception as e:
@@ -390,7 +391,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Base(primary_hue="neutral", secon
390
  inputs=[input_image],
391
  outputs=[category_html, audio_output, response_box]
392
  )
393
- gr.Markdown("<p>Upload, paste, or use your webcam to capture your outfit. DripAI evaluates your style using multiple AI models.</p>")
394
 
395
  # --- Launch App ---
396
  if __name__ == "__main__":
 
82
  all_prompts = []
83
  for cat_prompts in style_prompts.values():
84
  all_prompts.extend(cat_prompts)
85
+ style_prompts_end_index = len(all_prompts) # Mark where style prompts end dont mess up loop
86
  all_prompts.extend(clothing_prompts)
87
  print(f"Total prompts for CLIP: {len(all_prompts)}")
88
 
89
+ # Response Templates maybe not call out specific item all the time?
90
  response_templates = {
91
  'drippy': [
92
  "You're Drippy, bruh – fire {item}!", "{item} goes crazy, on god!", "Certified drippy with that {item}."
93
  ],
94
  'mid': [
95
  "Drop the {item} and you might get a text back.", "It's alright, but I'd upgrade the {item}.",
96
+ "Mid fit alert. That {item} is holding you back.", "We can do better come on now", "I dont think you want it enough"
97
  ],
98
  'not_drippy': [
99
  "Bro thought that {item} was tuff!", "Oh hell nah! Burn that {item}!",
100
  "Crimes against fashion, especially that {item}! Also… maybe get a haircut.",
101
  "Never walk out the house again with that {item}.",
102
  "Your drip is trash, try again.", # Generic trash response
103
+ "This ain't it chief. The overall style needs work.",
104
+ "Didn't need an AI to tell you to go back to the wardrobe"
105
  ]
106
  }
107
  CATEGORY_LABEL_MAP = { "drippy": "drippy", "mid": "mid", "not_drippy": "trash" }
 
252
  # f"with probability {clip_detected_item_prob:.2f}")
253
  else:
254
  print("I couldn't confidently identify specific clothing items via CLIP.")
255
+ clip_detected_item = "piece" # Use a different fallback if CLIP fails
256
  clip_detected_item_prob = 0.0 # Ensure prob is defined
257
 
258
  except Exception as e:
 
391
  inputs=[input_image],
392
  outputs=[category_html, audio_output, response_box]
393
  )
394
+ gr.Markdown("<p>Upload, paste, or use your camera to capture your outfit using the three icons. DripAI evaluates your style using multiple AI models.</p>")
395
 
396
  # --- Launch App ---
397
  if __name__ == "__main__":