DarkHelp  v1.9.2-1
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>

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");

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:

CreateDarkHelpNN
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
DestroyDarkHelpNN
void DestroyDarkHelpNN(DarkHelpPtr ptr)
Destroy the neural network object previously created with CreateDarkHelpNN().
Definition: DarkHelp_C_API.cpp:67
DarkHelp_C_API.h
GetPredictionResults
const char * GetPredictionResults(DarkHelpPtr ptr)
Get the last detection results from either PredictFN() or Predict().
Definition: DarkHelp_C_API.cpp:169
PredictFN
int PredictFN(DarkHelpPtr ptr, const char *const image_filename)
Calls DarkHelp::NN::predict() with the given image filename.
Definition: DarkHelp_C_API.cpp:90
DarkHelpPtr
void * DarkHelpPtr
The DarkHelpPtr type is only used by the C and Python APIs.
Definition: DarkHelp_C_API.h:42
Annotate
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:258