Saad0KH commited on
Commit
b224f7c
Β·
verified Β·
1 Parent(s): 7d8a54c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
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
- def process_image():
111
- nonlocal result
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: