This a clean and easy-to-use implementation of YOLOv7 in PyTorch, made with ❤️ by Theos AI.
Don't forget to read our Blog and subscribe to our YouTube Channel!
Always install the requirements inside a virtual environment:
pip install -r requirements.txt
If you run into issues installing some dependencies, first make sure you installed them inside a virtual environment. For cython-bbox, try installing it like this:
pip install -e git+/~https://github.com/samson-wang/cython_bbox.git#egg=cython-bbox
python image.py
python webcam.py
python video.py
output.mp4
Create a new text file called streams.txt inside the repository folder and put the URLs of the streams in each new line, for example:
https://192.168.0.203:8080/video
https://192.168.0.204:8080/video
https://192.168.0.205:8080/video
Then execute the streams script.
python streams.py
python track_video.py
python track_webcam.py
python ocr_image.py
This script uses a license plate recognition model (ANPR / ALPR), so you will have to edit it for it to work with your own model by changing the weights file, classes yaml file and finally the ocr_classes list.
python ocr_video.py
Watch the following tutorial to learn how to do it.
Go to your training experiment and click the weights button on the top right corner.
Download the best or last weights and the classes YAML file and put them inside the repository folder.
Change the following line to use your custom model.
yolov7.load('best.weights', classes='classes.yaml', device='cpu') # use 'gpu' for CUDA GPU inference
Reach out to contact@theos.ai if you have any questions!