Spaces:
Running
on
Zero
Running
on
Zero
Revert "coordinate test"
Browse filesThis reverts commit 4dd4700a1278d50479f2e991c1f4111cb14b307d.
app.py
CHANGED
@@ -102,8 +102,7 @@ def parse_coordinates(response, resized_width, resized_height, original_width, o
|
|
102 |
|
103 |
# Return as [x1, y1, x2, y2] format for bounding box
|
104 |
# convert the coordinates to the original image size
|
105 |
-
|
106 |
-
return [action_args[0], action_args[1], action_args[0], action_args[1]]
|
107 |
except Exception as e:
|
108 |
print(f"Error parsing coordinates: {e}\nResponse: {response}")
|
109 |
return None
|
|
|
102 |
|
103 |
# Return as [x1, y1, x2, y2] format for bounding box
|
104 |
# convert the coordinates to the original image size
|
105 |
+
return [action_args[0] / resized_width * original_width, action_args[1] / resized_height * original_height, action_args[0] / resized_width * original_width, action_args[1] / resized_height * original_height]
|
|
|
106 |
except Exception as e:
|
107 |
print(f"Error parsing coordinates: {e}\nResponse: {response}")
|
108 |
return None
|