Max-margin object detection convolution neural networks.
- Remove dlib dependency.
- You need only 1 files for MMODCNN object detection.
- Support windows, linux as same interface.
MMODCNN detector;
detector.Create("vehicle.dat", "names.txt");
cv::Mat img=cv::imread("a.jpg");
std::vector<BoxSE> boxes = detector.Detect(img, 0.5F);
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]
.
MMODCNNSE_Train.exe . training.xml hello 32 40 40 adam 500
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.
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.
This is dlib's MMODCNN wrapper. I added dynamic mini-batch loading module when training one step.
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
- CMake
- CUDA 10.0
- OpenCV(for testing)(included in repository)
- Visual Studio 2013, 2015, 2017
- NVIDIA GPU