YOLOv3 with python

I was wondering if there might be an option to YOLOv3 on a Jetson Xavier with a Python wrapper?

I know, there are some wrappers built by users, for example:
https://github.com/madhawav/YOLO3-4-Py
or https://github.com/mosheliv/tensortrt-yolo-python-api

but none of them was possible to install on my Jetson Xavier. Is there anyone who ever made some experience with a python wrapper for yolov3?

Hi LordCalvin, there is a YOLOv3 Python sample included with TensorRT, found at: /usr/src/tensorrt/samples/python/yolov3_onnx

Perhaps you could modify it to fit your needs for a YOLO API.

I use latest opencv release 4.2.0. Opencv dnn module has darknet support with cuda and python interface.

@scipio.it, can you use opencv yolov3 on xavier?

Yes, on xavier I can run 6 yolo networks on two fullhd streams in real time at 30FPS

Just wondering did you manually build the opencv 4.2.0 from source on Xavier? OR
It can be done using pip installer only?
@scipio.it

This is my script for opencv 4.2.0 build, inside a python 3.7 virtualenv as normal user and with dnn CUDA support.

#!/bin/bash

# sudo apt install -y python3.7 python3.7-dev python3.7-venv
# sudo apt install -y libtbb2 libtbb-dev 

CUDA="-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda -D WITH_CUDA=ON -D WITH_CUDNN=ON -D CUDA_GENERATION=Auto"

mkdir -p ~/external
cd ~/external

if [ ! -d opencv-4.2.0 ]; then
	[ -f 4.2.0.tar.gz ] || wget https://github.com/opencv/opencv/archive/4.2.0.tar.gz
	tar zxvf 4.2.0.tar.gz
fi

if [ ! -d opencv_contrib ]; then
	git clone https://github.com/opencv/opencv_contrib.git opencv_contrib
fi

mkdir -p opencv-4.2.0/release
cd opencv-4.2.0/release

JOBS=$(getconf _NPROCESSORS_ONLN)
JOBS=$(($JOBS - 1)) 

cmake \
	-D CMAKE_C_COMPILER="/usr/bin/cc" \
	-D CMAKE_CXX_COMPILER="/usr/bin/c++" \
	${CUDA} \
	-D CUDA_NVCC_FLAGS="-D_FORCE_INLINES" \
	-D CMAKE_BUILD_TYPE=RELEASE \
	-D BUILD_LIST=core,improc,videoio,dnn,python3,cudev,dnn_objdetect,highgui,video \
	-D CMAKE_INSTALL_PREFIX=${VIRTUAL_ENV} \
	-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
	-D WITH_TBB=ON \
	-D ENABLE_PRECOMPILED_HEADERS=OFF \
	-D BUILD_PERF_TESTS=OFF \
	-D CV_TRACE=OFF \
	-D WITH_OPENEXR=OFF \
	.. && \
make -j${JOBS} && \
make install/strip

Great and Thanks!! scipio.it