You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already have my grey scale images and i want to use it as an input instead of using points. how can i do that? , Here is my code block.
prompts = {}
ann_frame_idx = 0 # The frame index we interact with
ann_obj_id = 2 # Give a unique ID to each object we interact with (it can be any integer)
Add two positive clicks at (x, y) = (200, 900) and (50, 600) for the traversable road
points = np.array([[590, 500],[500,700],[250,980],[400,600]], dtype=np.float32)
labels = np.array([1,1,1,0], np.int32) # Two labels, both positive clicks
prompts[ann_obj_id] = points, labels # Store the points and labels for ann_obj_id
Iterate through output object IDs and display their prompts and masks
for i, out_obj_id in enumerate(out_obj_ids):
# Show the points corresponding to the current object
show_points(*prompts[out_obj_id], plt.gca())
# Show the mask for the current object
show_mask((out_mask_logits[i] > 0.0).cpu().numpy(), plt.gca(), obj_id=out_obj_id)..... i have attached a grey scale image
The text was updated successfully, but these errors were encountered:
I already have my grey scale images and i want to use it as an input instead of using points. how can i do that? , Here is my code block.
prompts = {}
ann_frame_idx = 0 # The frame index we interact with
ann_obj_id = 2 # Give a unique ID to each object we interact with (it can be any integer)
Add two positive clicks at (x, y) = (200, 900) and (50, 600) for the traversable road
points = np.array([[590, 500],[500,700],[250,980],[400,600]], dtype=np.float32)
labels = np.array([1,1,1,0], np.int32) # Two labels, both positive clicks
prompts[ann_obj_id] = points, labels # Store the points and labels for ann_obj_id
Add the new points or box
_, out_obj_ids, out_mask_logits = predictor.add_new_points_or_box(
inference_state=inference_state,
frame_idx=ann_frame_idx,
obj_id=ann_obj_id,
points=points,
labels=labels,
)
Show the results on the current (interacted) frame
plt.figure(figsize=(9, 6))
plt.title(f"frame {ann_frame_idx}")
Open and display the current frame image
plt.imshow(Image.open(os.path.join(video_dir, frame_names[ann_frame_idx])))
Show the input points
show_points(points, labels, plt.gca())
Iterate through output object IDs and display their prompts and masks
for i, out_obj_id in enumerate(out_obj_ids):
# Show the points corresponding to the current object
show_points(*prompts[out_obj_id], plt.gca())
# Show the mask for the current object
show_mask((out_mask_logits[i] > 0.0).cpu().numpy(), plt.gca(), obj_id=out_obj_id)..... i have attached a grey scale image
The text was updated successfully, but these errors were encountered: