Git Product home page Git Product logo

mmodcnn_springedition's Introduction

Not complete, It will not work now.

MMODCNN_SpringEdition

Max-margin object detection convolution neural networks.

MMODCNN C++ Windows and Linux interface library. (Train,Detect both)

  • Remove dlib dependency.
  • You need only 1 files for MMODCNN object detection.
  • Support windows, linux as same interface.

Example detection code.

MMODCNN detector;
detector.Create("vehicle.dat", "names.txt");
cv::Mat img=cv::imread("a.jpg");
std::vector<BoxSE> boxes = detector.Detect(img, 0.5F);

1. Setup for train.

1.1. Train detector

You need only 2 files for train that are MMODCNNSE_Train.exe and cudnn64_7.dll on Windows. If you are on Linux, then you need only MMODCNNSE_Train. This files are in build/Release after run cmake build.

There is a example training directory MMODCNN_SpringEdition_Train/. You can start training using above files.

The MMODCNN_Train.exe's arguments are [directory],[xml],[network name],[mini batch size] , [min detection width=40], [min detection height=40], [solver=sgd], [Cropper=350] and [min learning rate=0.0001].

Example
MMODCNNSE_Train.exe . training.xml hello 32 40 40 adam 500

2. Setup for detect

Just include MMODCNNSE.h and use it. See MMODCNN_SpringEdition_Test/. You need only MMODCNNSE.h, libMMODCNNSE.dll, opencv_world400.dll and cudnn64_7.dll for detect.

Reference

The class MMODCNN that in MMODCNNSE.h has 3 methods.

void Create(std::string dat, std::string names);

This method load trained model(weights) that has dat extension, and class naming file(names)

  • Parameter
    • dat : trained model path(e.g. "vehicle.dat")
    • names : class naming file(e.g. "names.txt")
std::vector<BoxSE> Detect(std::string file, float threshold);
std::vector<BoxSE> Detect(cv::Mat img, float threshold);

This method is detecting objects or classify of file,cv::Mat or IplImage.

  • Parameter
    • file : image file path
    • img : 3-channel image.
    • threshold : It removes predictive boxes if there score is less than threshold.
void Release();

Release loaded network.

Technical issue

This is dlib's MMODCNN wrapper. I added dynamic mini-batch loading module when training one step.

change log

build_windows.bat and build_linux.sh will download automatically correct version of cudnn. and build as cmake.

Windows + 1080ti + CUDA 10.0 + cudnn7.5      = 28FPS

Software requirement

  • CMake
  • CUDA 10.0
  • OpenCV(for testing)(included in repository)
  • Visual Studio 2013, 2015, 2017

Hardware requirement

  • NVIDIA GPU

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.