Skip to content

AmarJ/darknet-NN-framework

 
 

Repository files navigation

Darknet Neural Network Framework

Darknet is an open source neural network framework written in C and CUDA by Joseph Redmon.

Using Redmon's darknet framework I created my own implementation of YOLO (You Only Look Once) for my Kaptur logo recognition project. YOLO is a new approach to object detection that uses a single neural network to predict bounding boxes and class probabilities on full images in one evaluation (hence the name). The paper on YOLO is pretty easy to follow and nicely breaks down some machine learning concepts for none-PhDs like myself.

Use case

alt_text

Kaptur is an application running in the cloud that scrapes images off social media sites and looks for logos of popular brands such as Starbucks, Nike and Corona. Once a logo is found, the metadata around the post is collected and several object classifiers are run on the image to get more information about what’s in it. I am collecting data about how people around the world are using these brands and working on transforming this mountain of information into business insights.

Custom features I added to the framework

  • Watch folder: Images that are dropped into the watch folder are added to a queue and then run through the network for logo detection.

    alt text

  • Threading for network predictions: Once the neural network's weights are loaded, multiple classifier threads are created to make predictions on images simultaneously. Before this only one image was processed at a time. On less powerful machines, like an AWS micro instance or a Raspberry pi, this doubles and sometimes triples the rate at which images are processed.

  • Load balancing of the queue: Provides a pool of threads that are used to drain the queue. The number of threads created depends on the available virtual memory and stack size. Sometimes threads hang, so instead of losing that image and prediction, the image is added back to the queue and re-run through another thread. This avoids some OOM problems and keeps everything running smoothly.

Results from YOLO

So far I've been really happy with the results that I've gotten with YOLO.

alt text alt text alt text alt text

About

Darknet is an open source neural network framework written in C and CUDA by Joseph Redmon.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 88.3%
  • Cuda 9.9%
  • Other 1.8%