ultralytics 8.0.237 cv2.CAP_PROP fix and in_counts and out_counts displays (#7380)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: ayush chaurasia <ayush.chaurarsia@gmail.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> Co-authored-by: 曾逸夫(Zeng Yifu) <41098760+Zengyf-CVer@users.noreply.github.com>
This commit is contained in:
parent
71fe5e919d
commit
8c2b2f56b2
15 changed files with 108 additions and 90 deletions
|
|
@ -34,10 +34,9 @@ There are two types of instance segmentation tracking available in the Ultralyti
|
|||
model = YOLO("yolov8n-seg.pt")
|
||||
names = model.model.names
|
||||
cap = cv2.VideoCapture("path/to/video/file.mp4")
|
||||
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
|
||||
|
||||
out = cv2.VideoWriter('instance-segmentation.avi',
|
||||
cv2.VideoWriter_fourcc(*'MJPG'),
|
||||
30, (int(cap.get(3)), int(cap.get(4))))
|
||||
out = cv2.VideoWriter('instance-segmentation.avi', cv2.VideoWriter_fourcc(*'MJPG'), fps, (w, h))
|
||||
|
||||
while True:
|
||||
ret, im0 = cap.read()
|
||||
|
|
@ -80,10 +79,9 @@ There are two types of instance segmentation tracking available in the Ultralyti
|
|||
|
||||
model = YOLO("yolov8n-seg.pt")
|
||||
cap = cv2.VideoCapture("path/to/video/file.mp4")
|
||||
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
|
||||
|
||||
out = cv2.VideoWriter('instance-segmentation-object-tracking.avi',
|
||||
cv2.VideoWriter_fourcc(*'MJPG'),
|
||||
30, (int(cap.get(3)), int(cap.get(4))))
|
||||
out = cv2.VideoWriter('instance-segmentation-object-tracking.avi', cv2.VideoWriter_fourcc(*'MJPG'), fps, (w, h))
|
||||
|
||||
while True:
|
||||
ret, im0 = cap.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue