Add FastSAM and YOLO-World tracking docs (#10733)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
bc9fd45cdf
commit
15060e13cf
4 changed files with 61 additions and 6 deletions
|
|
@ -64,11 +64,16 @@ root.mainloop()
|
|||
# Path to json file, that created with above point selection app
|
||||
polygon_json_path = "bounding_boxes.json"
|
||||
|
||||
# Video Capture
|
||||
# Video capture
|
||||
cap = cv2.VideoCapture("Path/to/video/file.mp4")
|
||||
assert cap.isOpened(), "Error reading video file"
|
||||
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
|
||||
video_writer = cv2.VideoWriter("parking management.avi", cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h))
|
||||
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH,
|
||||
cv2.CAP_PROP_FRAME_HEIGHT,
|
||||
cv2.CAP_PROP_FPS))
|
||||
|
||||
# Video writer
|
||||
video_writer = cv2.VideoWriter("parking management.avi",
|
||||
cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h))
|
||||
|
||||
# Initialize parking management object
|
||||
management = ParkingManagement(model_path="yolov8n.pt")
|
||||
|
|
@ -77,6 +82,7 @@ root.mainloop()
|
|||
ret, im0 = cap.read()
|
||||
if not ret:
|
||||
break
|
||||
|
||||
json_data = management.parking_regions_extraction(polygon_json_path)
|
||||
results = management.model.track(im0, persist=True, show=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue