Skip to content
项目

ibaiGorordo/ONNX-YOLOv7-Object-Detection

在 GitHub 查看

关于

Python scripts performing object detection using the YOLOv7 model in ONNX.

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
-1
7天
-1
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

ONNX YOLOv7 Object Detection

Python scripts performing object detection using the YOLOv7 model in ONNX.

! ONNX YOLOv7 Object Detection Original image: https://www.flickr.com/photos/nicolelee/19041780

Important

  • The input images are directly resized to match the input size of the model. I skipped adding the pad to the input image, it might affect the accuracy of the model if the input image has a different aspect ratio compared to the input size of the model. Always try to get an input size with a ratio close to the input images you will use.

Requirements

  • Check the requirements.txt file.
  • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.

Installation

git clone https://github.com/ibaiGorordo/ONNX-YOLOv7-Object-Detection.git
cd ONNX-YOLOv7-Object-Detection
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

ONNX model

The original models were converted to different formats (including .onnx) by PINTO0309. Download the models from his repository. For that, you can either run the download_single_batch.sh or copy the google drive link inside that script in your browser to manually download the file. Then, extract and copy the downloaded onnx models (for example yolov7-tiny_480x640.onnx) to your models directory, and fix the file name in the python scripts accordingly.

  • The License of the models is GPL-3.0 license: License

Original YOLOv7 model

The original YOLOv7 model can be found in this repository: YOLOv7 Repository

Examples

  • Image inference:
python image_object_detection.py
  • Webcam inference:
python webcam_object_detection.py
python video_object_detection.py

!YOLOv7 detection video

Original video: https://youtu.be/zPre8MgmcHY

python comparison_with_yolov5_v6.py

!YOLOv7 Vs YOLOv5 detection video !YOLOv7 Vs YOLOv6 detection video Original video: https://youtu.be/zPre8MgmcHY

  • Replace the yolov5_v6_path with the actual path to the YOLOv5 or YOLOv6 model.
  • Convert YOLOv5 model to ONNX Open In Colab
  • Convert YOLOv6 model to ONNX Open In Colab

References:

探索相关项目

加载中…