Yolov5 + Deepsort + Regional detection for regional detection and tracking
For the environments:
pip install -r requirements.txt
The default weight is yolov5/weights/yolov5s.pt you can change it by add --yolo_weights xxx.pt
run python RegionDetect.py --source xxx.mp4 --show-vid for video detection
run python RegionDetect.py --source 0 --show-vid for stream detection use your own camera
For saving the results:
run python RegionDetect.py --source xxx.mp4 --show-vid --save-vid for video detection
run python RegionDetect.py --source 0 --show-vid --save-vid for stream detection use your own camera
The results are saved in inference/
If you want to change the detection region, go to RegionDetect.py line 96 to change the four points.
Go to yolov5/:
The default weight is yolov5s.pt you can change it by add --weights xxx.pt like:
python detect.py --source data/images --weights xxx.pt
run python detect.py --source data/images for image detection
run python detect.py --source xxx.mp4 for video detection
run python detect.py --source 0 for stream detection use your own camera
The results are saved in yolov5/results/