John Ho commited on
Commit
83a4265
·
1 Parent(s): 6a1ec3d

convert object_ids to list of int

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -180,6 +180,7 @@ def video_inference(input_video, prompt: str):
180
  if "masks" in post_processed:
181
  detected_masks = post_processed["masks"]
182
  object_ids = post_processed["object_ids"]
 
183
  if detected_masks.ndim == 4:
184
  detected_masks = detected_masks.squeeze(1)
185
  # detected_masks: (num_objects, H, W)
@@ -192,7 +193,7 @@ def video_inference(input_video, prompt: str):
192
  x0, y0, x1, y1 = xyxy
193
  det = {
194
  "frame": f_idx,
195
- "track_id": int(object_ids[i]) if object_ids is not None else i,
196
  "x": x0 / vid_w,
197
  "y": y0 / vid_h,
198
  "w": (x1 - x0) / vid_w,
 
180
  if "masks" in post_processed:
181
  detected_masks = post_processed["masks"]
182
  object_ids = post_processed["object_ids"]
183
+ object_ids = [int(oid) for oid in object_ids]
184
  if detected_masks.ndim == 4:
185
  detected_masks = detected_masks.squeeze(1)
186
  # detected_masks: (num_objects, H, W)
 
193
  x0, y0, x1, y1 = xyxy
194
  det = {
195
  "frame": f_idx,
196
+ "track_id": int(object_ids[i]),
197
  "x": x0 / vid_w,
198
  "y": y0 / vid_h,
199
  "w": (x1 - x0) / vid_w,