Hi, I want to share a truly unique solution today. It was originally presented on TED Talks about DarkNet by Joseph Redmon. Once I saw it, I wondered how to play with this solution on my MacBook Pro 13. As you may know, has not had GPU. I am mean. It has, but it is not very strong. But that was improved once I bought Sonnet eGFX 580 Puck… the funny thing is that they called 570, but OpenCL detected it as 580. It is natively supported by the latest macOS High Sierra 10.13.1, so I spent some time with CLion from Jet-Brains. I have made many modifications. First, I found someone brilliantly made a version of DarkNet with OpenCL. Still, I wondered if I could take the latest version of DarkNet from GitHub and make the same changes to have the latest code, but with OpenCL support without CUDA at all, so I did that for almost the whole weekend. Later I also found a way to path DarkNet with OpenCL to work on the latest macOS natively. And As you probably expect, the goals were achieved. You can see how it works on the AMD card in the below YT movie. Thanks for reading… I feel almost like C’s low-level developer after that last week. The results are amazing, in my opinion. Also, I want to thank one of my good friends who has a camera in his car and shared with me one recorded movie in this blog post. Thanks for reading. Below, you can find the whole solution in a nutshell and the source code in C with my patches… One more thing: the source code is with .git folders that I cloned Today, so you can see all my changes… Enjoy!
VIDEO/DEMO with NO AUDIO
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
brew install opencv
brew install clblas
brew install clfft
brew install clrng
brew install cmake
brew install wget
https://github.com/pjreddie/darknet PATHED darknet.zip (385 downloads) https://github.com/sowson/darknet ;-).
https://github.com/myestro/darknet PATHED darknet-opencl.zip (420 downloads)
BUILD & TESTS CMDs
rm -r build; mkdir build; cmake -Bbuild -H.; cmake –build build; cp build/darknet .
.darknet detect cfg/yolo.cfg ../weights/yolo.weights [picture/movie]
./darknet detector test cfg/combine9k.data cfg/yolo9000.cfg ../weights/yolo9000.weights [picture/movie]
./darknet detector demo cfg/coco.data cfg/yolo.cfg ../weights/yolo.weights [picture/movie] -thresh 0.25
./darknet detector demo cfg/voc.data cfg/tiny-yolo-voc.cfg ../weights/tiny-yolo-voc.weights [picture/movie] -thresh 0.05
THERE IS ONE MORE THING 😉