Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -104,16 +104,9 @@ def detect():
|
|
104 |
|
105 |
clothes = ["Upper-clothes", "Skirt", "Pants", "Dress"]
|
106 |
|
107 |
-
# Run the detection and segmentation in a separate thread
|
108 |
-
result = []
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
result = detect_and_segment_persons(image, clothes)
|
113 |
-
|
114 |
-
thread = threading.Thread(target=process_image)
|
115 |
-
thread.start()
|
116 |
-
thread.join() # Wait for the thread to finish
|
117 |
|
118 |
return jsonify({'images': result})
|
119 |
except Exception as e:
|
|
|
104 |
|
105 |
clothes = ["Upper-clothes", "Skirt", "Pants", "Dress"]
|
106 |
|
|
|
|
|
107 |
|
108 |
+
result = detect_and_segment_persons(image, clothes)
|
109 |
+
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
return jsonify({'images': result})
|
112 |
except Exception as e:
|