Spaces:
Runtime error
Runtime error
Commit
·
984922b
1
Parent(s):
e712a69
Update main.py
Browse files
main.py
CHANGED
@@ -70,14 +70,14 @@ def create_position_and_click_map(pos,action_type, image_height=48, image_width=
|
|
70 |
y_scaled = int(y / original_height * image_height)
|
71 |
|
72 |
# Clamp values to ensure they're within bounds
|
73 |
-
x_scaled = max(0, min(x_scaled,
|
74 |
-
y_scaled = max(0, min(y_scaled,
|
75 |
|
76 |
# Create binary position map
|
77 |
-
pos_map = torch.zeros((1,
|
78 |
pos_map[0, y_scaled, x_scaled] = 1.0
|
79 |
|
80 |
-
leftclick_map = torch.zeros((1,
|
81 |
if action_type == 'L':
|
82 |
leftclick_map[0, y_scaled, x_scaled] = 1.0
|
83 |
|
|
|
70 |
y_scaled = int(y / original_height * image_height)
|
71 |
|
72 |
# Clamp values to ensure they're within bounds
|
73 |
+
x_scaled = max(0, min(x_scaled, image_width - 1))
|
74 |
+
y_scaled = max(0, min(y_scaled, image_height - 1))
|
75 |
|
76 |
# Create binary position map
|
77 |
+
pos_map = torch.zeros((1, image_height, image_width))
|
78 |
pos_map[0, y_scaled, x_scaled] = 1.0
|
79 |
|
80 |
+
leftclick_map = torch.zeros((1, image_height, image_width))
|
81 |
if action_type == 'L':
|
82 |
leftclick_map[0, y_scaled, x_scaled] = 1.0
|
83 |
|