- Clone the repository
git clone https://github.com/hrjugar/yolov8-deepsort.git
- Go to the cloned folder.
cd yolov8-deepsort
- Install the dependencies.
pip install -e .
- Set the current directory.
cd ultralytics/yolo/v8/detect
-
Download sample video test3.mp4 from this link and save it in the current folder.
-
Run the command below.
python predict.py model=yolov8l.pt source="test3.mp4"
NOTE: There are a lot of other configurations made by their original authors. The ones listed here are configurations that have been verified to work by the current author.
| Configuration | Description | Possible Values |
|---|---|---|
| model | YOLOv8 model to use |
|
| source | The path of the video file to be analyzed by DeepSORT | Any video file path |
| show | Boolean flag for displaying video while DeepSORT is processing |
|
| save_dir | The path of the folder where the output will be saved | Any folder path |
| socket_port | The port to be used for the web sockets that will be used to communicate with the app. | Any available port number |
As of the moment, there are two outputs that are saved in the save_dir folder:
- The original input video file that has a bounding box marked on each object on each frame
- The results of DeepSORT in JSON, formatted in the following way:
[ // FRAME 1 [ // FRAME 1 OBJECT 1 { "id": 1, "classification": "car", "x": 501, "y": 395, "w": 152, "h": 122 }, // OTHER FRAME 1 OBJECTS ... ], // OTHER FRAMES ... ]