diff --git a/examples/heatmap_and_track/README.md b/examples/heatmap_and_track/README.md index 4cf1f2bc..c2339956 100644 --- a/examples/heatmap_and_track/README.md +++ b/examples/heatmap_and_track/README.md @@ -33,11 +33,10 @@ supervision package for multiple tasks such as drawing heatmap annotations, trac - `--source_weights_path`: Required. Specifies the path to the weights file for the YOLO model. This file contains the trained model data necessary for object detection. -- `--source_video_path`: Required. The path to the source video file that will be +- `--source_video_path` (optional): The path to the source video file that will be analyzed. This is the input video on which crowd analysis will be performed. -- `--target_video_path` (optional): The path to save the output video with annotations. -If not specified, the processed video will be displayed in real-time without being -saved. +If not specified default is `people-walking.mp4` from supervision assets +- `--target_video_path` (optional): The path to save the output.mp4 video with annotations. - `--confidence_threshold` (optional): Sets the confidence threshold for the YOLO model to filter detections. Default is `0.3`. This determines how confident the model should be to recognize an object in the video. @@ -54,11 +53,11 @@ particularly in distinguishing between different objects. ```bash python script.py \ ---source_weights_path data/crowd_analysis.pt \ ---source_video_path data/crowd_analysis.mov \ +--source_weights_path weight.pt \ +--source_video_path input_video.mp4 \ --confidence_threshold 0.3 \ --iou_threshold 0.5 \ ---target_video_path data/crowd_analysis_result.mov +--target_video_path output_video.mp4 ``` ## © license diff --git a/examples/heatmap_and_track/requirements.txt b/examples/heatmap_and_track/requirements.txt index 73963c75..ffc73e1f 100644 Binary files a/examples/heatmap_and_track/requirements.txt and b/examples/heatmap_and_track/requirements.txt differ diff --git a/examples/heatmap_and_track/script.py b/examples/heatmap_and_track/script.py index d00b3d58..a4eb80b9 100644 --- a/examples/heatmap_and_track/script.py +++ b/examples/heatmap_and_track/script.py @@ -4,6 +4,12 @@ import cv2 from ultralytics import YOLO import supervision as sv +from supervision.assets import VideoAssets, download_assets + + +def download_video() -> str: + download_assets(VideoAssets.PEOPLE_WALKING) + return VideoAssets.PEOPLE_WALKING.value def heatmap_and_track( @@ -106,13 +112,13 @@ if __name__ == "__main__": ) parser.add_argument( "--source_video_path", - required=True, + default=download_video(), help="Path to the source video file", type=str, ) parser.add_argument( "--target_video_path", - required=True, + default="output.mp4", help="Path to the target video file (output)", type=str, )