Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ async def full_detection_pipeline(image: UploadFile = File(...)):
|
|
107 |
|
108 |
eye_crops, error_msg = detect_eyes_roboflow(temp_image_path, raw_image)
|
109 |
if error_msg or len(eye_crops) != 2:
|
110 |
-
|
111 |
|
112 |
eye_crops.sort(key=lambda c: cv2.boundingRect(cv2.cvtColor(c, cv2.COLOR_BGR2GRAY))[0])
|
113 |
|
|
|
107 |
|
108 |
eye_crops, error_msg = detect_eyes_roboflow(temp_image_path, raw_image)
|
109 |
if error_msg or len(eye_crops) != 2:
|
110 |
+
return JSONResponse(status_code=200, content={"warnings": ["Exactly two eyes not detected."]})
|
111 |
|
112 |
eye_crops.sort(key=lambda c: cv2.boundingRect(cv2.cvtColor(c, cv2.COLOR_BGR2GRAY))[0])
|
113 |
|