#include "DarkHelp.hpp"#include <filesystem>#include <fstream>#include <iomanip>#include <thread>#include "json.hpp"
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 |
| void configure | ( | DarkHelp::NN & | nn, |
| const nlohmann::json & | j | ||
| ) |
References DarkHelp::Config::annotation_auto_hide_labels, DarkHelp::Config::annotation_font_face, DarkHelp::Config::annotation_font_thickness, DarkHelp::Config::annotation_include_duration, DarkHelp::Config::annotation_include_timestamp, DarkHelp::Config::annotation_shade_predictions, DarkHelp::Config::combine_tile_predictions, DarkHelp::NN::config, DarkHelp::NN::duration_string(), DarkHelp::Config::enable_debug, DarkHelp::Config::enable_tiles, DarkHelp::Config::fix_out_of_bound_values, DarkHelp::Config::include_all_names, DarkHelp::NN::init(), DarkHelp::kDarknet, DarkHelp::kOpenCV, DarkHelp::kOpenCVCPU, DarkHelp::Config::modify_batch_and_subdivisions, DarkHelp::NN::names, DarkHelp::Config::names_include_percentage, DarkHelp::NN::network_size(), DarkHelp::Config::non_maximal_suppression_threshold, DarkHelp::Config::only_combine_similar_predictions, DarkHelp::Config::sort_predictions, DarkHelp::Config::threshold, DarkHelp::Config::tile_edge_factor, DarkHelp::Config::tile_rect_factor, and DarkHelp::version().
Referenced by main().


| nlohmann::json create_darkhelp_defaults | ( | ) |
| void load_roi | ( | const std::filesystem::path & | src | ) |
References apply_roi, roi_fn, and roi_rectangles.
Referenced by server().

| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
References configure(), create_darkhelp_defaults(), merge(), messages, and server().

| nlohmann::json merge | ( | const nlohmann::json & | lhs, |
| const nlohmann::json & | rhs | ||
| ) |
| void process_image | ( | DarkHelp::NN & | nn, |
| cv::Mat & | mat, | ||
| const std::string & | stem | ||
| ) |
References DarkHelp::NN::annotate(), apply_roi, crop_and_save_detected_objects, DarkHelp::NN::duration_string(), DarkHelp::NN::horizontal_tiles, last_activity, DarkHelp::NN::names, DarkHelp::NN::predict(), roi_rectangles, save_annotated_image, save_json_results, save_txt_annotations, DarkHelp::NN::tile_size, total_number_of_images_processed, and DarkHelp::NN::vertical_tiles.
Referenced by 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().


| bool apply_roi = false |
Referenced by load_roi(), process_image(), and server().
| bool crop_and_save_detected_objects = false |
Referenced by process_image(), and server().
| auto last_activity = std::chrono::high_resolution_clock::now() |
Referenced by process_image(), and server().
| std::filesystem::path roi_fn |
Referenced by load_roi(), and server().
| std::vector<cv::Rect> roi_rectangles |
Referenced by load_roi(), and process_image().
| bool save_annotated_image = false |
Referenced by process_image(), and server().
| bool save_json_results = false |
Referenced by process_image(), and server().
| bool save_txt_annotations = false |
Referenced by process_image(), and server().
| size_t total_number_of_images_processed = 0 |
Referenced by process_image(), and server().