Spaces:
Sleeping
Sleeping
Update api_server.py
Browse files- api_server.py +4 -1
api_server.py
CHANGED
@@ -118,9 +118,12 @@ def predict():
|
|
118 |
image_data = Image.open(file)
|
119 |
except Exception as e:
|
120 |
return jsonify({'error': str(e)}), 400
|
121 |
-
|
|
|
122 |
# Make a prediction using YOLO
|
123 |
results = model(image_data)
|
|
|
|
|
124 |
|
125 |
# 檢查 YOLO 是否返回了有效的結果
|
126 |
if results is None or len(results) == 0:
|
|
|
118 |
image_data = Image.open(file)
|
119 |
except Exception as e:
|
120 |
return jsonify({'error': str(e)}), 400
|
121 |
+
|
122 |
+
print("***Start YOLO predict***")
|
123 |
# Make a prediction using YOLO
|
124 |
results = model(image_data)
|
125 |
+
print("***YOLO predict DONE***")
|
126 |
+
check_memory_usage()
|
127 |
|
128 |
# 檢查 YOLO 是否返回了有效的結果
|
129 |
if results is None or len(results) == 0:
|