Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -147,12 +147,18 @@ def get_top_clip_clothing(probs, n=1):
|
|
| 147 |
return top_items_with_probs
|
| 148 |
|
| 149 |
# --- Core Logic ---
|
| 150 |
-
def analyze_outfit(input_img: Image.Image):
|
| 151 |
-
if input_img is None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
return ("<p style='color: #FF5555; text-align: center;'>Please upload an image.</p>",
|
| 153 |
None, "Error: No image provided.")
|
| 154 |
|
| 155 |
-
|
| 156 |
|
| 157 |
# 1) YOLO Person Detection
|
| 158 |
person_results = yolo_person_model(img, verbose=False, conf=YOLO_PERSON_CONF_THRESHOLD)
|
|
|
|
| 147 |
return top_items_with_probs
|
| 148 |
|
| 149 |
# --- Core Logic ---
|
| 150 |
+
#def analyze_outfit(input_img: Image.Image):
|
| 151 |
+
#if input_img is None:
|
| 152 |
+
#return ("<p style='color: #FF5555; text-align: center;'>Please upload an image.</p>",
|
| 153 |
+
#None, "Error: No image provided.")
|
| 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)
|