diff --git a/examples/traffic_analysis/README.md b/examples/traffic_analysis/README.md index c05098ef..c57a1ad5 100644 --- a/examples/traffic_analysis/README.md +++ b/examples/traffic_analysis/README.md @@ -38,6 +38,24 @@ https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c- ## 🛠️ script arguments +- ultralytics + + - `--source_weights_path`: Required. Specifies the path to the YOLO model's weights + file, which is essential for the object detection process. This file contains the + data that the model uses to identify objects in the video. + + - `--source_video_path`: Required. The path to the source video file that will be + analyzed. This is the input video on which traffic flow 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. + - `--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. + - `--iou_threshold` (optional): Specifies the IOU (Intersection Over Union) threshold + for the model. Default is 0.7. This value is used to manage object detection + accuracy, particularly in distinguishing between different objects. + - inference - `--roboflow_api_key` (optional): The API key for Roboflow services. If not provided @@ -59,37 +77,8 @@ https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c- for the model. Default is 0.7. This value is used to manage object detection accuracy, particularly in distinguishing between different objects. -- ultralytics - - - `--source_weights_path`: Required. Specifies the path to the YOLO model's weights - file, which is essential for the object detection process. This file contains the - data that the model uses to identify objects in the video. - - - `--source_video_path`: Required. The path to the source video file that will be - analyzed. This is the input video on which traffic flow 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. - - `--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. - - `--iou_threshold` (optional): Specifies the IOU (Intersection Over Union) threshold - for the model. Default is 0.7. This value is used to manage object detection - accuracy, particularly in distinguishing between different objects. - ## ⚙️ run -- inference - - ```bash - python inference_example.py \ - --roboflow_api_key \ - --source_video_path data/traffic_analysis.mov \ - --confidence_threshold 0.3 \ - --iou_threshold 0.5 \ - --target_video_path data/traffic_analysis_result.mov - ``` - - ultralytics ```bash @@ -101,6 +90,17 @@ https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c- --target_video_path data/traffic_analysis_result.mov ``` +- inference + + ```bash + python inference_example.py \ + --roboflow_api_key \ + --source_video_path data/traffic_analysis.mov \ + --confidence_threshold 0.3 \ + --iou_threshold 0.5 \ + --target_video_path data/traffic_analysis_result.mov + ``` + ## © license This demo integrates two main components, each with its own licensing: diff --git a/examples/traffic_analysis/inference_example.py b/examples/traffic_analysis/inference_example.py index a6f85c66..ac8389be 100644 --- a/examples/traffic_analysis/inference_example.py +++ b/examples/traffic_analysis/inference_example.py @@ -188,6 +188,12 @@ if __name__ == "__main__": help="Roboflow model ID", type=str, ) + parser.add_argument( + "--roboflow_api_key", + default=None, + help="Roboflow API KEY", + type=str, + ) parser.add_argument( "--source_video_path", required=True, @@ -210,12 +216,6 @@ if __name__ == "__main__": "--iou_threshold", default=0.7, help="IOU threshold for the model", type=float ) - parser.add_argument( - "--roboflow_api_key", - default=None, - help="Roboflow API key", - type=str, - ) args = parser.parse_args()