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!
DarkHelpServer.cpp File Reference
#include "DarkHelp.hpp"
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <thread>
#include "json.hpp"
Include dependency graph for DarkHelpServer.cpp:

Functions

void configure (DarkHelp::NN &nn, const nlohmann::json &j)
 
nlohmann::json create_darkhelp_defaults ()
 
void load_roi (const std::filesystem::path &src)
 
int main (int argc, char *argv[])
 
nlohmann::json merge (const nlohmann::json &lhs, const nlohmann::json &rhs)
 
void process_image (DarkHelp::NN &nn, cv::Mat &mat, const std::string &stem)
 
void server (DarkHelp::NN &nn, const nlohmann::json &j)
 

Variables

bool apply_roi = false
 
bool crop_and_save_detected_objects = false
 
auto last_activity = std::chrono::high_resolution_clock::now()
 
std::vector< std::string > messages
 
std::filesystem::path roi_fn
 
std::vector< cv::Rect > roi_rectangles
 
bool save_annotated_image = false
 
bool save_json_results = false
 
bool save_txt_annotations = false
 
size_t total_number_of_images_processed = 0
 

Function Documentation

◆ configure()

◆ create_darkhelp_defaults()

nlohmann::json create_darkhelp_defaults ( )

Referenced by main().

Here is the caller graph for this function:

◆ load_roi()

void load_roi ( const std::filesystem::path &  src)

References apply_roi, roi_fn, and roi_rectangles.

Referenced by server().

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

References configure(), create_darkhelp_defaults(), merge(), messages, and server().

Here is the call graph for this function:

◆ merge()

nlohmann::json merge ( const nlohmann::json &  lhs,
const nlohmann::json &  rhs 
)

References messages.

Referenced by main().

Here is the caller graph for this function:

◆ process_image()

◆ server()

void server ( DarkHelp::NN nn,
const nlohmann::json &  j 
)

References apply_roi, crop_and_save_detected_objects, last_activity, load_roi(), process_image(), roi_fn, save_annotated_image, save_json_results, save_txt_annotations, and total_number_of_images_processed.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ apply_roi

bool apply_roi = false

Referenced by load_roi(), process_image(), and server().

◆ crop_and_save_detected_objects

bool crop_and_save_detected_objects = false

Referenced by process_image(), and server().

◆ last_activity

auto last_activity = std::chrono::high_resolution_clock::now()

Referenced by process_image(), and server().

◆ messages

std::vector<std::string> messages

Referenced by main(), and merge().

◆ roi_fn

std::filesystem::path roi_fn

Referenced by load_roi(), and server().

◆ roi_rectangles

std::vector<cv::Rect> roi_rectangles

Referenced by load_roi(), and process_image().

◆ save_annotated_image

bool save_annotated_image = false

Referenced by process_image(), and server().

◆ save_json_results

bool save_json_results = false

Referenced by process_image(), and server().

◆ save_txt_annotations

bool save_txt_annotations = false

Referenced by process_image(), and server().

◆ total_number_of_images_processed

size_t total_number_of_images_processed = 0

Referenced by process_image(), and server().