Explorer Cleanup (#7364)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Muhammad Rizwan Munawar <chr043416@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
aca8eb1fd4
commit
ed73c0fedc
15 changed files with 585 additions and 63 deletions
|
|
@ -91,16 +91,18 @@ There are two types of instance segmentation tracking available in the Ultralyti
|
|||
print("Video frame is empty or video processing has been successfully completed.")
|
||||
break
|
||||
|
||||
results = model.track(im0, persist=True)
|
||||
masks = results[0].masks.xy
|
||||
track_ids = results[0].boxes.id.int().cpu().tolist()
|
||||
|
||||
annotator = Annotator(im0, line_width=2)
|
||||
|
||||
for mask, track_id in zip(masks, track_ids):
|
||||
annotator.seg_bbox(mask=mask,
|
||||
mask_color=colors(track_id, True),
|
||||
track_label=str(track_id))
|
||||
results = model.track(im0, persist=True)
|
||||
|
||||
if results[0].boxes.id is not None:
|
||||
masks = results[0].masks.xy
|
||||
track_ids = results[0].boxes.id.int().cpu().tolist()
|
||||
|
||||
for mask, track_id in zip(masks, track_ids):
|
||||
annotator.seg_bbox(mask=mask,
|
||||
mask_color=colors(track_id, True),
|
||||
track_label=str(track_id))
|
||||
|
||||
out.write(im0)
|
||||
cv2.imshow("instance-segmentation-object-tracking", im0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue