Alessio Grancini
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -254,11 +254,16 @@ def get_detection_data(image_data):
|
|
254 |
img = np.array(img)
|
255 |
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
256 |
|
257 |
-
#
|
258 |
-
print(f"
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
262 |
|
263 |
#image = utils.resize(img)
|
264 |
resized_image = utils.resize(img) #depth requires resizing
|
|
|
254 |
img = np.array(img)
|
255 |
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
256 |
|
257 |
+
# Log received values for reference (settings applied by prior API calls)
|
258 |
+
print(f"Received settings from payload (reference) - Model Size: {model_size}, Confidence Threshold: {confidence_threshold}")
|
259 |
+
# Verify actual models and threshold used
|
260 |
+
expected_yolo = "yolov8s-seg" if model_size == "Small - Better performance and less accuracy" else \
|
261 |
+
"yolov8m-seg" if model_size == "Medium - Balanced performance and accuracy" else "yolov8l-seg"
|
262 |
+
expected_midas = "midas_v21_small_256" if model_size == "Small - Better performance and less accuracy" else \
|
263 |
+
"dpt_hybrid_384" if model_size == "Medium - Balanced performance and accuracy" else "dpt_large_384"
|
264 |
+
print(f"Expected YOLO model: {expected_yolo}, Actual YOLO model: {img_seg.model_type}")
|
265 |
+
print(f"Expected MiDaS model: {expected_midas}, Actual MiDaS model: {depth_estimator.model_type}")
|
266 |
+
print(f"Actual confidence threshold: {img_seg.confidence_threshold}")
|
267 |
|
268 |
#image = utils.resize(img)
|
269 |
resized_image = utils.resize(img) #depth requires resizing
|