DarkHelp  v1.8.6-4
C++ API for the neural network framework Darknet
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
DarkHelp.hpp File Reference

DarkHelp is a C++ helper layer for accessing Darknet. More...

#include <chrono>
#include <filesystem>
#include <map>
#include <string>
#include <vector>
#include <list>
#include <opencv2/opencv.hpp>
#include "DarkHelpPredictionResult.hpp"
#include "DarkHelpConfig.hpp"
#include "DarkHelpNN.hpp"
#include "DarkHelpUtils.hpp"
#include "DarkHelpPositionTracker.hpp"
#include "DarkHelp_C_API.h"
Include dependency graph for DarkHelp.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 DarkHelp
 The DarkHelp namespace contains (almost) everything in the DarkHelp library.
 

Typedefs

using DarkHelp::MStr = std::map< std::string, std::string >
 Map of strings where both the key and the value are std::string. More...
 
using DarkHelp::VColours = std::vector< cv::Scalar >
 Vector of colours to use by DarkHelp::NN::annotate(). More...
 
using DarkHelp::VFloat = std::vector< float >
 Vector of float used with OpenCV. More...
 
using DarkHelp::VInt = std::vector< int >
 Vector of int used with OpenCV. More...
 
using DarkHelp::VRect = std::vector< cv::Rect >
 Vector of OpenCV rectangles used with OpenCV. More...
 
using DarkHelp::VRect2d = std::vector< cv::Rect2d >
 Similar to DarkHelp::VRect, but the rectangle uses double instead of int. More...
 
using DarkHelp::VStr = std::vector< std::string >
 Vector of text strings. Typically used to store the class names. More...
 

Enumerations

enum class  DarkHelp::EDriver {
  DarkHelp::kInvalid = 0 ,
  DarkHelp::kMin = 1 ,
  DarkHelp::kDarknet = kMin ,
  DarkHelp::kOpenCV ,
  DarkHelp::kOpenCVCPU ,
  DarkHelp::kMax = kOpenCVCPU
}
 DarkHelp can utilise either libdarknet.so or OpenCV's DNN module to load the neural network and run inference. More...
 
enum class  DarkHelp::ESort {
  DarkHelp::kUnsorted = 0 ,
  DarkHelp::kAscending ,
  DarkHelp::kDescending ,
  DarkHelp::kPageOrder
}
 

Detailed Description

DarkHelp is a C++ helper layer for accessing Darknet.

It was developed and tested with AlexeyAB's fork of the popular Darknet project, which is now maintained by Hank.ai: https://github.com/hank-ai/darknet

Note
The original darknet.h header file defines structures in the global namespace with names such as "image" and "network" which are likely to cause problems in large existing projects. For this reason, the DarkHelp class uses a void* for the network and will only include darknet.h if explicitly told it can.

Unless you are using darknet's "image" class directly in your application, it is probably best to NOT define the DARKHELP_CAN_INCLUDE_DARKNET macro, and not include darknet.h. (The header is included by DarkHelpNN.cpp, so you definitely still need to have it, but the scope of where it is needed is confined to that one .cpp file.)