YOLOV7_Object_Counter_Trim21_Trim.mp4
Social Distance with Yolov7
- Count all objetcs by classes and works perfetcly on every image or on a video
- Code can run on Both (CPU & GPU)
- Video/WebCam/External Camera/IP Stream Supported
https://www.youtube.com/watch?v=nB8L54-ejgQ
https://www.youtube.com/watch?v=vANr6aC7QOY
https://colab.research.google.com/drive/1URG1BruRkVQawZGqCJ1ibV_SeYhEBdKd?usp=sharing
- clone the repository:
!git clone https://github.com/DoganK01/YOLOV7-OBJECT-COUNTER-V1.2.git
cd /content/YOLOV7-OBJECT-COUNTER-V1.2
pip install --upgrade pip
!pip install -r requirements.txt
%%bash
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7x.pt
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6.pt
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-d6.pt
wget -P /content/YOLOV7-OBJECT-COUNTER-V1.2/weights https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6e.pt
- NOTE: You can use any of these. If one doesn't work, try the other.
!pip install --upgrade pyyaml==5.3.1
- For Close People with Red Lines:
!python detect.py --weights /content/Yolov7-Close-People-Counter/weights/yolov7x.pt --source /content/Yolov7-Close-People-Counter/inference/images/bus.jpg --no-trace
- For Close People "Counter":
!python counter.py --weights /content/Yolov7-Close-People-Counter/weights/yolov7x.pt --source /content/Yolov7-Close-People-Counter/inference/images/bus.jpg --no-trace
- For Object Counter:
!python detect_and_count.py --weights /content/Yolov7-Close-People-Counter/weights/yolov7x.pt --source /content/Yolov7-Close-People-Counter/inference/images/bus.jpg --no-trace
Test.23._Trim.mp4
Test.21._Trim2.mp4
Saving people who break the social distance by increasing the resolution from real-video: (Real-ESRGAN):