yuntian-deng commited on
Commit
984922b
·
1 Parent(s): e712a69

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
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, image_size - 1))
74
- y_scaled = max(0, min(y_scaled, image_size - 1))
75
 
76
  # Create binary position map
77
- pos_map = torch.zeros((1, image_size, image_size))
78
  pos_map[0, y_scaled, x_scaled] = 1.0
79
 
80
- leftclick_map = torch.zeros((1, image_size, image_size))
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