docs(example): readme.md usage fixes

feat: default video set to people-walking.mp4 output to output.mp4
fix: re-create requirements.txt(fix end of line corruption)

Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
This commit is contained in:
Onuralp SEZER committed 2023-12-29 00:24:40 +03:00
1 parent 263d88bf77
commit a2dbe9e53a
3 files changed
+14 -9

No files matched your search

+6 -7
View File
@@ -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
Binary file not shown.
+8 -2
View File
@@ -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,
)