Macros | |
#define | DARKNET_LOC __FILE__, __func__, __LINE__ |
#define | max_val_cmp(a, b) (((a) > (b)) ? (a) : (b)) |
#define | min_val_cmp(a, b) (((a) < (b)) ? (a) : (b)) |
#define | xcalloc(m, s) xcalloc_location(m, s, DARKNET_LOC) |
#define | xmalloc(s) xmalloc_location(s, DARKNET_LOC) |
#define | xrealloc(p, s) xrealloc_location(p, s, DARKNET_LOC) |
Functions | |
int | alphanum_to_int (char c) |
const char * | basecfg (const char *cfgfile) |
boxabs | box_to_boxabs (const Darknet::Box *b, const int img_w, const int img_h, const int bounds_check) |
void | calloc_error (const size_t size, const char *const filename, const char *const funcname, const int line) |
int | check_array_is_inf (float *arr, int size) |
int | check_array_is_nan (float *arr, int size) |
float | constrain (float min, float max, float a) |
char * | copy_string (char *s) |
int | count_fields (char *line) |
unsigned long | custom_hash (char *str) |
void | darknet_fatal_error (const char *const filename, const char *const funcname, const int line, const char *const msg,...) |
Calling this function ends the application. This function will never return control back to the caller. | |
float | dist_array (float *a, float *b, int n, int sub) |
double | double_rand (void) |
char * | fgetl (FILE *fp) |
void | file_error (const char *const s, const char *const filename, const char *const funcname, const int line) |
int | find_arg (int argc, char *argv[], const char *const arg) |
const char * | find_char_arg (int argc, char **argv, const char *arg, const char *def) |
float | find_float_arg (int argc, char **argv, const char *const arg, float def) |
int | find_int_arg (int argc, char **argv, const char *const arg, int def) |
void | find_replace (const char *str, char *orig, char *rep, char *output) |
void | free_ptrs (void **ptrs, int n) |
This is part of the original C API. | |
int | int_index (int *a, int val, int n) |
char | int_to_alphanum (int i) |
bool | is_live_stream (const char *path) |
float | mag_array (float *a, int n) |
float | mag_array_skip (float *a, int n, int *indices_to_skip) |
int | make_directory (char *path, int mode) |
void | malloc_error (const size_t size, const char *const filename, const char *const funcname, const int line) |
int | max_index (float *a, int n) |
int | max_int_index (int *a, int n) |
float | mean_array (float *a, int n) |
void | mean_arrays (float **a, int n, int els, float *avg) |
float | mse_array (float *a, int n) |
void | normalize_array (float *a, int n) |
float ** | one_hot_encode (float *a, int n, int k) |
list * | parse_csv_line (char *line) |
float * | parse_fields (char *line, int n) |
void | print_statistics (float *a, int n) |
int | rand_int (int min, int max) |
int | rand_int_fast (int min, int max) |
float | rand_normal () |
float | rand_precalc_random (float min, float max, float random_part) |
float | rand_scale (float s) |
size_t | rand_size_t () |
float | rand_uniform (float min, float max) |
float | rand_uniform_strong (float min, float max) |
float | random_float () |
float | random_float_fast () |
unsigned int | random_gen (unsigned int min=0, unsigned int max=std::numeric_limits< unsigned int >::max()) |
unsigned int | random_gen_fast (void) |
int * | random_index_order (int min, int max) |
void | read_all (int fd, char *buffer, size_t bytes) |
int | read_all_fail (int fd, char *buffer, size_t bytes) |
int | read_int (int fd) |
int * | read_map (const char *filename) |
void | realloc_error (const size_t size, const char *const filename, const char *const funcname, const int line) |
void | replace_image_to_label (const char *input_path, char *output_path) |
int | sample_array (float *a, int n) |
int | sample_array_custom (float *a, int n) |
void | scale_array (float *a, int n, float s) |
float | sec (clock_t clocks) |
void | shuffle (void *arr, size_t n, size_t size) |
const char * | size_to_IEC_string (const size_t size) |
Convert the given size to a human-readable string. This uses 1024 as a divider, so 1 KiB == 1024 bytes. | |
void | sorta_shuffle (void *arr, size_t n, size_t size, size_t sections) |
list * | split_str (char *s, char delim) |
void | strip (char *s) |
void | strip_args (char *s) |
void | strip_char (char *s, char bad) |
float | sum_array (float *a, int n) |
void | top_k (float *a, int n, int k, int *index) |
int | top_max_index (float *a, int n, int k) |
void | translate_array (float *a, int n, float s) |
unsigned int | uint_rand (unsigned int less_than) |
float | variance_array (float *a, int n) |
double | what_time_is_it_now () |
Convert the current time – as seconds – into a double. | |
void | write_all (int fd, char *buffer, size_t bytes) |
int | write_all_fail (int fd, char *buffer, size_t bytes) |
void | write_int (int fd, int n) |
void * | xcalloc_location (const size_t nmemb, const size_t size, const char *const filename, const char *const funcname, const int line) |
void * | xmalloc_location (const size_t size, const char *const filename, const char *const funcname, const int line) |
void * | xrealloc_location (void *ptr, const size_t size, const char *const filename, const char *const funcname, const int line) |
#define DARKNET_LOC __FILE__, __func__, __LINE__ |
#define max_val_cmp | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
#define min_val_cmp | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
#define xcalloc | ( | m, | |
s | |||
) | xcalloc_location(m, s, DARKNET_LOC) |
#define xmalloc | ( | s | ) | xmalloc_location(s, DARKNET_LOC) |
#define xrealloc | ( | p, | |
s | |||
) | xrealloc_location(p, s, DARKNET_LOC) |
int alphanum_to_int | ( | char | c | ) |
const char * basecfg | ( | const char * | cfgfile | ) |
boxabs box_to_boxabs | ( | const Darknet::Box * | b, |
const int | img_w, | ||
const int | img_h, | ||
const int | bounds_check | ||
) |
void calloc_error | ( | const size_t | size, |
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
int check_array_is_inf | ( | float * | arr, |
int | size | ||
) |
int check_array_is_nan | ( | float * | arr, |
int | size | ||
) |
float constrain | ( | float | min, |
float | max, | ||
float | a | ||
) |
char * copy_string | ( | char * | s | ) |
int count_fields | ( | char * | line | ) |
unsigned long custom_hash | ( | char * | str | ) |
void darknet_fatal_error | ( | const char *const | filename, |
const char *const | funcname, | ||
const int | line, | ||
const char *const | msg, | ||
... | |||
) |
Calling this function ends the application. This function will never return control back to the caller.
float dist_array | ( | float * | a, |
float * | b, | ||
int | n, | ||
int | sub | ||
) |
double double_rand | ( | void | ) |
char * fgetl | ( | FILE * | fp | ) |
void file_error | ( | const char *const | s, |
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
int find_arg | ( | int | argc, |
char * | argv[], | ||
const char *const | arg | ||
) |
const char * find_char_arg | ( | int | argc, |
char ** | argv, | ||
const char * | arg, | ||
const char * | def | ||
) |
float find_float_arg | ( | int | argc, |
char ** | argv, | ||
const char *const | arg, | ||
float | def | ||
) |
int find_int_arg | ( | int | argc, |
char ** | argv, | ||
const char *const | arg, | ||
int | def | ||
) |
void find_replace | ( | const char * | str, |
char * | orig, | ||
char * | rep, | ||
char * | output | ||
) |
void free_ptrs | ( | void ** | ptrs, |
int | n | ||
) |
This is part of the original C
API.
int int_index | ( | int * | a, |
int | val, | ||
int | n | ||
) |
char int_to_alphanum | ( | int | i | ) |
bool is_live_stream | ( | const char * | path | ) |
float mag_array | ( | float * | a, |
int | n | ||
) |
float mag_array_skip | ( | float * | a, |
int | n, | ||
int * | indices_to_skip | ||
) |
int make_directory | ( | char * | path, |
int | mode | ||
) |
void malloc_error | ( | const size_t | size, |
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
int max_index | ( | float * | a, |
int | n | ||
) |
int max_int_index | ( | int * | a, |
int | n | ||
) |
float mean_array | ( | float * | a, |
int | n | ||
) |
void mean_arrays | ( | float ** | a, |
int | n, | ||
int | els, | ||
float * | avg | ||
) |
float mse_array | ( | float * | a, |
int | n | ||
) |
void normalize_array | ( | float * | a, |
int | n | ||
) |
float ** one_hot_encode | ( | float * | a, |
int | n, | ||
int | k | ||
) |
list * parse_csv_line | ( | char * | line | ) |
float * parse_fields | ( | char * | line, |
int | n | ||
) |
void print_statistics | ( | float * | a, |
int | n | ||
) |
int rand_int | ( | int | min, |
int | max | ||
) |
int rand_int_fast | ( | int | min, |
int | max | ||
) |
float rand_normal | ( | ) |
float rand_precalc_random | ( | float | min, |
float | max, | ||
float | random_part | ||
) |
float rand_scale | ( | float | s | ) |
size_t rand_size_t | ( | ) |
float rand_uniform | ( | float | min, |
float | max | ||
) |
float rand_uniform_strong | ( | float | min, |
float | max | ||
) |
float random_float | ( | ) |
float random_float_fast | ( | ) |
unsigned int random_gen | ( | unsigned int | min = 0 , |
unsigned int | max = std::numeric_limits< unsigned int >::max() |
||
) |
unsigned int random_gen_fast | ( | void | ) |
int * random_index_order | ( | int | min, |
int | max | ||
) |
void read_all | ( | int | fd, |
char * | buffer, | ||
size_t | bytes | ||
) |
int read_all_fail | ( | int | fd, |
char * | buffer, | ||
size_t | bytes | ||
) |
int read_int | ( | int | fd | ) |
int * read_map | ( | const char * | filename | ) |
void realloc_error | ( | const size_t | size, |
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
void replace_image_to_label | ( | const char * | input_path, |
char * | output_path | ||
) |
int sample_array | ( | float * | a, |
int | n | ||
) |
int sample_array_custom | ( | float * | a, |
int | n | ||
) |
void scale_array | ( | float * | a, |
int | n, | ||
float | s | ||
) |
float sec | ( | clock_t | clocks | ) |
void shuffle | ( | void * | arr, |
size_t | n, | ||
size_t | size | ||
) |
const char * size_to_IEC_string | ( | const size_t | size | ) |
Convert the given size to a human-readable string. This uses 1024 as a divider, so 1 KiB == 1024 bytes.
void sorta_shuffle | ( | void * | arr, |
size_t | n, | ||
size_t | size, | ||
size_t | sections | ||
) |
list * split_str | ( | char * | s, |
char | delim | ||
) |
void strip | ( | char * | s | ) |
void strip_args | ( | char * | s | ) |
void strip_char | ( | char * | s, |
char | bad | ||
) |
float sum_array | ( | float * | a, |
int | n | ||
) |
void top_k | ( | float * | a, |
int | n, | ||
int | k, | ||
int * | index | ||
) |
int top_max_index | ( | float * | a, |
int | n, | ||
int | k | ||
) |
void translate_array | ( | float * | a, |
int | n, | ||
float | s | ||
) |
unsigned int uint_rand | ( | unsigned int | less_than | ) |
float variance_array | ( | float * | a, |
int | n | ||
) |
double what_time_is_it_now | ( | ) |
Convert the current time – as seconds – into a double.
Precision is microseconds (10^-6). It takes 1000 microseconds to make 1 millisecond.
void write_all | ( | int | fd, |
char * | buffer, | ||
size_t | bytes | ||
) |
int write_all_fail | ( | int | fd, |
char * | buffer, | ||
size_t | bytes | ||
) |
void write_int | ( | int | fd, |
int | n | ||
) |
void * xcalloc_location | ( | const size_t | nmemb, |
const size_t | size, | ||
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
void * xmalloc_location | ( | const size_t | size, |
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |
void * xrealloc_location | ( | void * | ptr, |
const size_t | size, | ||
const char *const | filename, | ||
const char *const | funcname, | ||
const int | line | ||
) |