Inference with yolov7's onnx model
pip install -U pip && pip install -r requirements.txt
Ubuntu 20.04
FROM ubuntu:20.04
USER root
RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
LABEL version="1.0"
LABEL description="Build operating environment for yolov7-onnx-infer"
RUN apt-get update && \
apt-get -y install python3-pip && \
apt-get -y install git && \
apt-get -y install libgl1-mesa-dev && \
apt-get -y install libglib2.0-0 && \
pip install -U pip && \
pip install opencv-python onnxruntime
Debian
FROM debian:stable-slim
USER root
LABEL version="1.0"
LABEL description="Build operating environment for yolov7-onnx-infer"
RUN apt-get update && \
apt-get -y install python3-pip && \
apt-get -y install git && \
apt-get -y install libgl1-mesa-dev && \
apt-get -y install libglib2.0-0 && \
pip install -U pip && \
pip install opencv-python onnxruntime
docker build -t tatsuya060504/yolov7-onnx-infer:v1.0.0 .
docker pull tatsuya060504/yolov7-onnx-infer:raspberrypi
docker run
docker run -it --name=yolov7-onnx-infer -v $(pwd):/home tatsuya060504/yolov7-onnx-infer:raspberrypi
You can download the yolox-onnx model by executing the shell script in the model folder.
cd model
sh download_yolov7_tiny_onnx.sh #or download_yolov7_onnx.sh
python onnx_inference.py -i <image_path> -m <onnx_model_path> -e <class_name> -s <score_threshold>
python onnx_inference.py -mo video -i <video_path> -m <onnx_model_path> -e <class_name> -s <score_threshold>