Code Monkey home page Code Monkey logo

ncnn-yolo's Introduction

ncnn-yolo

convert pytorch trained yolo model to ncnn for Flexible deployment

Introduction

We use pytorch_0.2 to train our model, it's advantages are very flexible. Then we use PytorchConvert convert our model to ncnn.

ncnn is a high-performance neural network inference computing framework optimized for mobile platforms. With it, we can easily deploy deep learning algorithm models to the mobile platform.

workflow

  1. train yolov1 model, we use this reposity pytorch-YOLO-v1, attention, we must use ceil_mode=True when pooling is used.

  2. Convert model

  3. check the output is correct or not, write decoder in c/c++

how to

step1

cd pytorch-yolo-v1
python train.py

best.pth will produced in /pytorch-yolo-v1

step2

cd pytorchConvert/code
python run.py

converted model will in /pytorchConvert/ModelFiles/ResNet/

our model name is ResNet, because we use resnet50 as backbone, and I forget change class name, anyway, rename it to yolo1.param and yolo1.bin

step3

cd ncnn
mkdir build
cd build
cmake ..
make -j4

uncomment add_subdirectory(examples) in ncnn/CMakeLists.txt

cd build
cmake ..
make -j4

copy yolo1.param yolo1.bin to build/examples

cd build
cd examples
./xiong_yolo1 person.jpg

Hopeful results

ncnn-yolo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ncnn-yolo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.