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!
DarkHelpCli.cpp File Reference
#include "DarkHelp.hpp"
#include <random>
#include <chrono>
#include <fstream>
#include <atomic>
#include <map>
#include <vector>
#include <deque>
#include <string>
#include <ctime>
#include <csignal>
#include <tclap/CmdLine.h>
#include "json.hpp"
#include <unistd.h>
#include <magic.h>
Include dependency graph for DarkHelpCli.cpp:

Classes

class  DirExistConstraint
 
class  DriverConstraint
 
class  FileExistConstraint
 
class  FloatConstraint
 
class  IntConstraint
 
struct  Options
 
class  OutputImageConstraint
 
class  WxHConstraint
 

Functions

void cli_signal_handler (int sig)
 
void display_current_msg (Options &options, cv::Mat output_image, int &delay_in_milliseconds)
 
bool get_bool (TCLAP::ValueArg< std::string > &arg)
 
cv::Size get_WxH (const std::string &text)
 
cv::Size get_WxH (TCLAP::ValueArg< std::string > &arg)
 
void init (Options &options, int argc, char *argv[])
 
int main (int argc, char *argv[])
 
void process_image (Options &options)
 
void process_video (Options &options)
 
void set_msg (Options &options, const std::string &msg)
 
void show_help_window ()
 

Variables

const int KEY_c = 0x63
 
const int KEY_COMPLEX_MASK = 0x00ffffff
 
const int KEY_d = 0x64
 
const int KEY_DOWN = 0x0010ff54
 
const int KEY_END = 0x0010ff57
 
const int KEY_ESC = 0x1b
 
const int KEY_g = 0x67
 
const int KEY_h = 0x68
 
const int KEY_HOME = 0x0010ff50
 
const int KEY_l = 0x6c
 
const int KEY_LEFT = 0x0010ff51
 
const int KEY_p = 0x70
 
const int KEY_PAGE_DOWN = 0x0010ff56
 
const int KEY_PAGE_UP = 0x0010ff55
 
const int KEY_q = 0x71
 
const int KEY_RIGHT = 0x0010ff53
 
const int KEY_s = 0x73
 
const int KEY_SIMPLE_MASK = 0xff
 
const int KEY_t = 0x74
 
const int KEY_u = 0x75
 
const int KEY_UP = 0x0010ff52
 
const int KEY_w = 0x77
 
std::atomic< bool > signal_raised = false
 

Function Documentation

◆ cli_signal_handler()

void cli_signal_handler ( int  sig)

References signal_raised.

Referenced by main().

Here is the caller graph for this function:

◆ display_current_msg()

void display_current_msg ( Options options,
cv::Mat  output_image,
int &  delay_in_milliseconds 
)

◆ get_bool()

bool get_bool ( TCLAP::ValueArg< std::string > &  arg)

Referenced by init().

Here is the caller graph for this function:

◆ get_WxH() [1/2]

cv::Size get_WxH ( const std::string &  text)

Referenced by WxHConstraint::check(), get_WxH(), and init().

Here is the caller graph for this function:

◆ get_WxH() [2/2]

cv::Size get_WxH ( TCLAP::ValueArg< std::string > &  arg)

References get_WxH().

Here is the call graph for this function:

◆ init()

void init ( Options options,
int  argc,
char *  argv[] 
)

References Options::all_files, DarkHelp::Config::annotation_auto_hide_labels, DarkHelp::Config::annotation_font_scale, DarkHelp::Config::annotation_include_duration, DarkHelp::Config::annotation_include_timestamp, DarkHelp::Config::annotation_line_thickness, DarkHelp::Config::annotation_pixelate_enabled, DarkHelp::Config::annotation_shade_predictions, DarkHelp::Config::annotation_suppress_all_labels, Options::cfg_fn, DarkHelp::NN::config, Options::done, DarkHelp::NN::duration_string(), DarkHelp::Config::enable_debug, DarkHelp::Config::enable_tiles, Options::file_index, Options::force_greyscale, get_bool(), get_WxH(), DarkHelp::Config::hierarchy_threshold, Options::image_type, Options::in_slideshow, DarkHelp::NN::init(), Options::json, DarkHelp::kDarknet, Options::keep_annotated_images, DarkHelp::kOpenCV, DarkHelp::kOpenCVCPU, Options::magic_cookie, DarkHelp::NN::names, Options::names_fn, DarkHelp::Config::names_include_percentage, DarkHelp::NN::network_size(), Options::neural_network_name, Options::nn, DarkHelp::Config::non_maximal_suppression_threshold, Options::out_dir, DarkHelp::Config::redirect_darknet_output, signal_raised, Options::size1, Options::size1_is_set, Options::size2, Options::size2_is_set, DarkHelp::Config::snapping_enabled, DarkHelp::Config::snapping_horizontal_tolerance, DarkHelp::Config::snapping_vertical_tolerance, DarkHelp::Config::threshold, DarkHelp::Config::tile_edge_factor, DarkHelp::Config::tile_rect_factor, Options::use_json_output, DarkHelp::verify_cfg_and_weights(), Options::wait_time_in_milliseconds_for_slideshow, and Options::weights_fn.

Referenced by DarkHelp::DHThreads::init(), DarkHelp::NN::init(), and main().

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

◆ main()

◆ process_image()

◆ process_video()

◆ set_msg()

void set_msg ( Options options,
const std::string &  msg 
)

References Options::message_text, and Options::message_time.

Referenced by main(), and process_image().

Here is the caller graph for this function:

◆ show_help_window()

void show_help_window ( )

Referenced by process_image().

Here is the caller graph for this function:

Variable Documentation

◆ KEY_c

const int KEY_c = 0x63

Referenced by process_image().

◆ KEY_COMPLEX_MASK

const int KEY_COMPLEX_MASK = 0x00ffffff

Referenced by process_image().

◆ KEY_d

const int KEY_d = 0x64

Referenced by process_image().

◆ KEY_DOWN

const int KEY_DOWN = 0x0010ff54

Referenced by process_image().

◆ KEY_END

const int KEY_END = 0x0010ff57

Referenced by process_image().

◆ KEY_ESC

const int KEY_ESC = 0x1b

Referenced by process_image().

◆ KEY_g

const int KEY_g = 0x67

Referenced by process_image().

◆ KEY_h

const int KEY_h = 0x68

Referenced by process_image().

◆ KEY_HOME

const int KEY_HOME = 0x0010ff50

Referenced by process_image().

◆ KEY_l

const int KEY_l = 0x6c

Referenced by process_image().

◆ KEY_LEFT

const int KEY_LEFT = 0x0010ff51

Referenced by process_image().

◆ KEY_p

const int KEY_p = 0x70

Referenced by process_image().

◆ KEY_PAGE_DOWN

const int KEY_PAGE_DOWN = 0x0010ff56

Referenced by process_image().

◆ KEY_PAGE_UP

const int KEY_PAGE_UP = 0x0010ff55

Referenced by process_image().

◆ KEY_q

const int KEY_q = 0x71

Referenced by process_image().

◆ KEY_RIGHT

const int KEY_RIGHT = 0x0010ff53

◆ KEY_s

const int KEY_s = 0x73

Referenced by process_image().

◆ KEY_SIMPLE_MASK

const int KEY_SIMPLE_MASK = 0xff

Referenced by process_image().

◆ KEY_t

const int KEY_t = 0x74

Referenced by process_image().

◆ KEY_u

const int KEY_u = 0x75

Referenced by process_image().

◆ KEY_UP

const int KEY_UP = 0x0010ff52

Referenced by process_image().

◆ KEY_w

const int KEY_w = 0x77

Referenced by process_image().

◆ signal_raised

std::atomic<bool> signal_raised = false