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 C API

The DarkHelp C API is a simplified wrapper API for the C++ API.

To use the DarkHelp C API, you must include the project header file within your application:

#include <DarkHelp_C_API.h>
This is the C API for DarkHelp.

The C API requires that a void* object be allocated to represent the DarkHelp object in C++. That void* pointer is then passed in to all the function calls.

DarkHelpPtr dh = CreateDarkHelpNN("cars.cfg", "cars.names", "cars_best.weights");
PredictFN(dh, "test.jpg");
results = GetPredictionResults(dh);
Annotate(dh, "output.jpg");
void DestroyDarkHelpNN(DarkHelpPtr ptr)
Destroy the neural network object previously created with CreateDarkHelpNN().
Definition: DarkHelp_C_API.cpp:64
void Annotate(DarkHelpPtr ptr, const char *const output_image_filename)
Calls DarkHelp::NN::annotate() on the last image and results from either PredictFN() or Predict().
Definition: DarkHelp_C_API.cpp:255
DarkHelpPtr CreateDarkHelpNN(const char *const fn1, const char *const fn2, const char *const fn3)
Create a DarkHelp::NN object.
Definition: DarkHelp_C_API.cpp:48
const char * GetPredictionResults(DarkHelpPtr ptr)
Get the last detection results from either PredictFN() or Predict().
Definition: DarkHelp_C_API.cpp:166
int PredictFN(DarkHelpPtr ptr, const char *const image_filename)
Calls DarkHelp::NN::predict() with the given image filename.
Definition: DarkHelp_C_API.cpp:87
void * DarkHelpPtr
The DarkHelpPtr type is only used by the C and Python APIs.
Definition: DarkHelp_C_API.h:42

See the example application src-apps/using_c_api.cpp for sample code which shows how to use the C API.

Convenient links to some of the API call documentation to get started: