All Projects → stephanecharette → DarkHelp

stephanecharette / DarkHelp

Licence: MIT License
C++ wrapper library for Darknet

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to DarkHelp

darknet2caffe
Conversion of yolo from DarkNet to Caffe
Stars: ✭ 25 (-61.54%)
Mutual labels:  yolo, darknet
DarkMark
Marking up images for use with Darknet.
Stars: ✭ 62 (-4.62%)
Mutual labels:  yolo, darknet
pnn
pnn is Darknet compatible neural nets inference engine implemented in Rust.
Stars: ✭ 17 (-73.85%)
Mutual labels:  yolo, darknet
darknet-vis
Visualize YOLO feature map in prediction for easily checking your model performance
Stars: ✭ 68 (+4.62%)
Mutual labels:  yolo, darknet
lightDenseYOLO
A real-time object detection app based on lightDenseYOLO Our lightDenseYOLO is the combination of two components: lightDenseNet as the CNN feature extractor and YOLO v2 as the detection module
Stars: ✭ 20 (-69.23%)
Mutual labels:  yolo, darknet
DroNet
DroNet: Efficient convolutional neural network detector for Real-Time UAV applications
Stars: ✭ 54 (-16.92%)
Mutual labels:  yolo, darknet
JSON2YOLO
Convert JSON annotations into YOLO format.
Stars: ✭ 222 (+241.54%)
Mutual labels:  yolo, darknet
DarkPlate
License plate parsing using Darknet and YOLO
Stars: ✭ 36 (-44.62%)
Mutual labels:  yolo, darknet
VideoRecognition-realtime-autotrainer-alerts
State of the art object detection in real-time using YOLOV3 algorithm. Augmented with a process that allows easy training of the classifier as a plug & play solution . Provides alert if an item in an alert list is detected.
Stars: ✭ 36 (-44.62%)
Mutual labels:  yolo, darknet
ffcnn
ffcnn is a cnn neural network inference framework, written in 600 lines C language.
Stars: ✭ 50 (-23.08%)
Mutual labels:  yolo, darknet
OpenCV-Flask
🐛 🐛 Opencv视频流传输到网页浏览器并做目标检测 🐛 🐛
Stars: ✭ 35 (-46.15%)
Mutual labels:  yolo, darknet
object-tracking
Multiple Object Tracking System in Keras + (Detection Network - YOLO)
Stars: ✭ 89 (+36.92%)
Mutual labels:  yolo, darknet
darknet
php ffi darknet
Stars: ✭ 21 (-67.69%)
Mutual labels:  yolo, darknet
live-cctv
To detect any reasonable change in a live cctv to avoid large storage of data. Once, we notice a change, our goal would be track that object or person causing it. We would be using Computer vision concepts. Our major focus will be on Deep Learning and will try to add as many features in the process.
Stars: ✭ 23 (-64.62%)
Mutual labels:  yolo, darknet
vehicle-rear
Vehicle-Rear: A New Dataset to Explore Feature Fusion For Vehicle Identification Using Convolutional Neural Networks
Stars: ✭ 99 (+52.31%)
Mutual labels:  yolo, darknet
darknet.js
A NodeJS wrapper of pjreddie's darknet / yolo.
Stars: ✭ 61 (-6.15%)
Mutual labels:  yolo, darknet
darknet-nnpack
Darknet with NNPACK
Stars: ✭ 302 (+364.62%)
Mutual labels:  yolo, darknet
yolor
implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
Stars: ✭ 1,867 (+2772.31%)
Mutual labels:  yolo, darknet
Tracking-with-darkflow
Real-time people Multitracker using YOLO v2 and deep_sort with tensorflow
Stars: ✭ 522 (+703.08%)
Mutual labels:  yolo, darknet
go-darknet
Go bindings for Darknet (YOLO v4 / v3)
Stars: ✭ 56 (-13.85%)
Mutual labels:  yolo, darknet

What is the DarkHelp C++ API?

The DarkHelp C++ API is a wrapper to make it easier to use the Darknet neural network framework within a C++ application. DarkHelp performs the following:

  • load a Darknet-style neural network (.cfg, .names, .weights)
  • run inference on images -- either filenames or OpenCV cv::Mat images and video frames -- and return a vector of results
  • optionally annotate images/frames with the inference results

Example annotated image after calling DarkHelp::NN::predict() and DarkHelp::NN::annotate():

annotated image example

What is the DarkHelp CLI?

DarkHelp also has a very simple command-line tool that uses the DarkHelp C++ API so some of the functionality can be accessed directly from the command-line. This can be useful to run tests or for shell scripting.

What is the DarkHelp Server?

DarkHelp Server is a command-line tool that loads a neural network once, and then keeps running in the background. It repeatedly applies the network to images or video frames and saves the results.

Unlike Darknet and the DarkHelp CLI which have to re-load the neural network every time they're called, DarkHelp Server only does this once. DarkHelp Server can be configured to save the results in .txt format, .json format, annotate images, and can also crop the objects and create individual image files from each of the objects detected by the neural network.

License

DarkHelp is open source and published using the MIT license. Meaning you can use it in your commercial application. See license.txt for details.

How to Build DarkHelp (Linux)

Extremely simple easy-to-follow tutorial on how to build Darknet, DarkHelp, and DarkMark.

DarkHelp build tutorial

DarkHelp requires that Darknet has already been built and installed, since DarkHelp is a wrapper for the C functionality available in libdarknet.so.

Building Darknet (Linux)

You must build Darknet with the LIBSO=1 variable set to have it build libdarknet.so. On Ubuntu:

sudo apt-get install build-essential git libopencv-dev
cd ~/src
git clone https://github.com/AlexeyAB/darknet.git
cd darknet
# edit Makefile to set LIBSO=1, and possibly other flags
make
sudo cp libdarknet.so /usr/local/lib/
sudo cp include/darknet.h /usr/local/include/
sudo ldconfig

Building DarkHelp (Linux)

Now that Darknet is built and installed, you can go ahead and build DarkHelp. On Ubuntu:

sudo apt-get install cmake build-essential libtclap-dev libmagic-dev libopencv-dev
cd ~/src
git clone https://github.com/stephanecharette/DarkHelp.git
cd DarkHelp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make package
sudo dpkg -i darkhelp*.deb

Building Darknet (Windows)

The Windows build uses vcpkg to install the necessary 3rd-party libraries such as OpenCV. See the files readme_windows.txt and build_windows.cmd for details.

Start the "Developer Command Prompt for Visual Studio" (not Power Shell!) and run the following commands to build Darknet and OpenCV:

cd c:\src
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
vcpkg.exe integrate install
vcpkg.exe integrate powershell
vcpkg.exe install opencv[contrib,core,dnn,ffmpeg,jpeg,png,quirc,tiff,webp]:x64-windows darknet[opencv-base]:x64-windows

Building DarkHelp (Windows)

Once you finish building Darknet and OpenCV, run the following commands in the "Developer Command Prompt for VS" to build DarkHelp:

cd c:\src\vcpkg
vcpkg.exe install tclap:x64-windows
cd c:\src
git clone https://github.com/stephanecharette/DarkHelp.git
cd darkhelp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake ..
msbuild.exe /property:Platform=x64;Configuration=Release /target:Build -maxCpuCount -verbosity:normal -detailedSummary DarkHelp.sln

Make sure you update the path to the toolchain file if you used a different directory.

If you have NSIS installed, then you can create an installation package with this command:

msbuild.exe /property:Platform=x64;Configuration=Release PACKAGE.vcxproj

Example Code

DarkHelp has many optional settings that impact the output, especially DarkHelp::NN::annotate().

To keep it simple this example code doesn't change any settings. It uses the default values as it runs inference on several images and saves the output:

// include DarkHelp.hpp and link against libdarkhelp, libdarknet, and OpenCV
//
const auto samples_images = {"dog.jpg", "cat.jpg", "horse.jpg"};
//
// Only do this once.  You don't want to keep reloading the network inside
// the loop because loading the network is actually a long process that takes
// several seconds to run to finish.
DarkHelp::NN nn("animals.cfg", "animals_best.weights", "animals.names");
//
for (const auto & filename : samples_images)
{
    // get the predictions; on a decent GPU this should take milliseconds,
    // while on a CPU this might take a full second or more
    const auto results = nn.predict(filename);
    //
    // display the results on the console
    // (meaning coordinates and confidence levels, not displaying the image)
    std::cout << results << std::endl;
    //
    // annotate the image and save the results
    cv::Mat output = nn.annotate();
    cv::imwrite("output_" + filename, output, {CV_IMWRITE_PNG_COMPRESSION, 9});
}

C++ API Doxygen Output

The official DarkHelp documentation and web site is at https://www.ccoderun.ca/darkhelp/.

Some links to specific useful pages:

tiled image example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].