YOLOv2 for Matlab is a fork of the Matlab MEX wrapper Yolomex by Ignacio Rocco with Matlab demos for LED control and people tracking.
- This is using the original darknet framework, so it's meant to run on Unix (OSX/Linux).
- openMP is not included into gcc in OSX - you can still use your own compiler.
- Don't be stupid: change paths, if you're using different versions!
git clone --recursive https://github.com/kbitr/matlab-yolov2
- Adjust CC path (OSX)
- CUDA: Set "GPU=1"
- openMP: Set "OPENMP=1"
make
mex -I./darknet/include/ -I./darknet/src CFLAGS='-Wall -Wfatal-errors -Wno-unused-result -fPIC' -L. -lyolo -L/usr/local/cuda/lib64 -lcudart -lcublas -lcurand yolomex.c
mex -I./darknet/include/ -I./darknet/src/ -L. -lyolo yolomex.c
main*.m
Well, yeah - just install LLVM.
brew install llvm
- The following overwrites the mex-compiler config for c-files!
- It's recommended to store the clang_openmp_maci64.xml in ~/Library/Application Support/MathWorks/MATLAB/R2017b.
- Adjust path in the below command if necessary
mex -setup:'~/Library/Application Support/MathWorks/MATLAB/R2017b/clang_openmp_maci64.xml' C
That happens when your GPU is running out of memory, since Matlab isn't aware of the memory usage. You should reduce the the batch value .cfg-file to a lower multiple of 32. (But other values work as well.)
By the way, for speeding up the detection you can reduce the width and height.