🔥 (yolov3 yolov4 yolov5 unet ...)A mini pytorch inference framework which inspired from darknet.
OS supported (you can check other OS by yourself)
windows | linux | mac | Loongnix | |
---|---|---|---|---|
checked | ||||
gpu |
CPU checked
Intel i7 | raspberry 3B | raspberry 4B | Jeston NX | Loongson | |
---|---|---|---|---|---|
checked |
Features
Tested networks
Yolo Test
Win10 MSVC 2017 I7-10700F
net | yolov3 | yolov3_tiny | yolov4 |
---|---|---|---|
time | 380ms | 50ms | 432ms |
ARM(Yolov3Tiny cpu)
cpu | raspberry 3B | raspberry 4B | Jeston NX |
---|---|---|---|
with neon asm | ? | 0.432s | ? |
Yolo GPU Test
Ubuntu16.04 GCC Cuda10.1 GTX1080Ti
net | yolov3 | yolov3_tiny | yolov4 |
---|---|---|---|
time | 30ms | 8ms | 30ms |
Jetson NX
net | yolov3 | yolov3_tiny | yolov4 |
---|---|---|---|
time | 200ms | 20ms | 210ms |
Yolo GPU cuDnn FP16 Test
net | yolov3 | yolov4 |
---|---|---|
time | 115ms | 120ms |
Yolov5s GPU Test
net | yolov5s | yolov5s_fp16 |
---|---|---|
time | 9.57ms | 8.57ms |
Mobilenet Yolo GPU cuDnn Test
net | yoloface100k | yoloface500k | mobilenetv2_yolov3_nano | mobilenetv2_yolov3_lite |
---|---|---|---|---|
time | 7ms | 20ms | 20ms | 30ms |
DeepLabv3 GPU Test
net | deeplabv3_resnet101 | deeplabv3_resnet50 |
---|---|---|
time | 22.51ms | 16.46ms |
Requirements
Video tutorials(bilibili)
How to build
With CMake 3.15+
Viewer can not build with GPU.
Options ps. You can change omp threads by unchecking OMP_MAX_THREAD and modifying "num" val at CMakeLists.txt:52
Windows
ps. If you want to build with Jetson, please uncheck NNPACK, OPENBLAS, NEON.
sudo apt-get install build-essential
sudo apt-get install qt5-default #optional
sudo apt-get install libqt5svg5-dev #optional
sudo apt-get install libopencv-dev #optional
sudo apt-get install libgl1-mesa-dev libglfw3-dev libglfw3 libglew-dev #optional
#config
sudo echo /usr/local/lib > /etc/ld.so.conf.d/usrlib.conf
sudo ldconfig
# build Msnhnet
git clone https://github.com/msnh2012/Msnhnet.git
mkdir build
cd Msnhnet/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
vim ~/.bashrc # Last line add: export PATH=/usr/local/bin:$PATH
sudo ldconfig
PS: XCode should be pre-installed.
Please download cmake from official website with gui support and the source code of yaml and opencv.
# install cmake
vim .bash_profile
export CMAKE_ROOT=/Applications/CMake.app/Contents/bin/
export PATH=$CMAKE_ROOT:$PATH
source .bash_profile
# install brew to install necessary libraries
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install wget
brew install openjpeg
brew install hdf5
brew install gflags
brew install glog
brew install eigen
brew install libomp
# build yaml-cpp
git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
source .bash_profile
cmake-gui
Set the source code path: ./yaml-cpp
Set the build binary path: ./yaml-cpp/build
configure
CMAKE_BUILD_TYPE = Release
uncheck YAML_CPP_BUILD_TESTS
configure (and continue to debug)
generate
cd ./yaml-cpp/build
sudo make install -j8
# build opencv
# download opencv.zip from official website(Remember to download opencv-contrib together)
cd opencv-4.4.0
mkdir build
source .bash_profile
cmake-gui
Set the source code path: ./opencv-4.4.0
Set the build binary path: ./opencv-4.4.0/build
configure (use default)
search for OPENCV_ENABLE_NONFREE and enable it
seach for OPENCV_EXTRA_MODULES_PATH to the path of opencv-contrib
configure (and continue to debug)
generate
cd ./opencv-4.4.0/build/
sudo make install -j8
# build Msnhnet
git clone https://github.com/msnh2012/Msnhnet.git
mkdir build
cd Msnhnet/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
Test Msnhnet
View Msnhnet
PS. You can double click "ResBlock Res2Block AddBlock ConcatBlock" node to view more detail ResBlock
Res2Block
AddBlock
ConcatBlock
How to convert your own pytorch network
About Train
Enjoy it! :D
Acknowledgement
Msnhnet got ideas and developed based on these projects:
3rdparty Libs
加群交流