dzmu commited on
Commit
e0dc749
·
verified ·
1 Parent(s): 0b1e306

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -154,11 +154,14 @@ def get_top_clip_clothing(probs, n=1):
154
 
155
  #img = input_img.convert("RGB").copy() # Ensure image is in RGB
156
  def analyze_outfit(image_path):
157
- if not image_path:
158
- return ("<p style='color: #FF5555; text-align: center;'>Please upload an image.</p>",
159
- None, "Error: No image provided.")
160
-
161
- input_img = Image.open(image_path).convert("RGB").copy()
 
 
 
162
 
163
  # 1) YOLO Person Detection
164
  person_results = yolo_person_model(img, verbose=False, conf=YOLO_PERSON_CONF_THRESHOLD)
 
154
 
155
  #img = input_img.convert("RGB").copy() # Ensure image is in RGB
156
  def analyze_outfit(image_path):
157
+ if not image_path or not os.path.exists(image_path):
158
+ return (
159
+ "<p style='color: #FF5555; text-align: center;'>Please upload an image.</p>",
160
+ None,
161
+ "Error: No image provided."
162
+ )
163
+
164
+ img = Image.open(image_path).convert("RGB").copy()
165
 
166
  # 1) YOLO Person Detection
167
  person_results = yolo_person_model(img, verbose=False, conf=YOLO_PERSON_CONF_THRESHOLD)