Mar2Ding commited on
Commit
e17f634
·
verified ·
1 Parent(s): 0444ea4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -156,8 +156,8 @@ def get_point(point_type, tracking_points, trackings_input_label, input_first_fr
156
  # Create a transparent layer to draw on
157
  transparent_layer = np.zeros((h, w, 4), dtype=np.uint8)
158
 
159
- for index, track in enumerate(tracking_points.value):
160
- if trackings_input_label.value[index] == 1:
161
  cv2.circle(transparent_layer, track, radius, (0, 255, 0, 255), -1)
162
  else:
163
  cv2.circle(transparent_layer, track, radius, (255, 0, 0, 255), -1)
@@ -284,9 +284,9 @@ def get_mask_sam_process(
284
  ann_obj_id = 1 # give a unique id to each object we interact with (it can be any integers)
285
 
286
  # Let's add a positive click at (x, y) = (210, 350) to get started
287
- points = np.array(tracking_points.value, dtype=np.float32)
288
  # for labels, `1` means positive click and `0` means negative click
289
- labels = np.array(trackings_input_label.value, np.int32)
290
  _, out_obj_ids, out_mask_logits = predictor.add_new_points(
291
  inference_state=inference_state,
292
  frame_idx=ann_frame_idx,
 
156
  # Create a transparent layer to draw on
157
  transparent_layer = np.zeros((h, w, 4), dtype=np.uint8)
158
 
159
+ for index, track in enumerate(tracking_points):
160
+ if trackings_input_label[index] == 1:
161
  cv2.circle(transparent_layer, track, radius, (0, 255, 0, 255), -1)
162
  else:
163
  cv2.circle(transparent_layer, track, radius, (255, 0, 0, 255), -1)
 
284
  ann_obj_id = 1 # give a unique id to each object we interact with (it can be any integers)
285
 
286
  # Let's add a positive click at (x, y) = (210, 350) to get started
287
+ points = np.array(tracking_points, dtype=np.float32)
288
  # for labels, `1` means positive click and `0` means negative click
289
+ labels = np.array(trackings_input_label, np.int32)
290
  _, out_obj_ids, out_mask_logits = predictor.add_new_points(
291
  inference_state=inference_state,
292
  frame_idx=ann_frame_idx,