Darknet/YOLO v3.0-177-gfa2353b
Object Detection Framework
 
Loading...
Searching...
No Matches
darknet_network.hpp File Reference
Include dependency graph for darknet_network.hpp:
This graph shows which files directly or indirectly include this file:

Classes

struct  Darknet::Network
 Neural network structure. Contains all of the layers. Created by Darknet::CfgFile::create_network(). More...
 
struct  Darknet::NetworkDetails
 A place to store other details related to the neural network which we cannot easily add to the usual Darknet::Network structure. More...
 
struct  Darknet::NetworkState
 

Namespaces

namespace  Darknet
 The namespace for the C++ Darknet API.
 

Functions

void backward_network (Darknet::Network &net, Darknet::NetworkState state)
 
void backward_network_gpu (Darknet::Network &net, Darknet::NetworkState state)
 
void copy_weights_net (const Darknet::Network &net_train, Darknet::Network *net_map)
 
char * Darknet::detection_to_json (Darknet::Detection *dets, int nboxes, int classes, const Darknet::VStr &names, long long int frame_id, char *filename)
 
void ema_apply (Darknet::Network &net)
 
void ema_update (Darknet::Network &net, float ema_alpha)
 
void forward_backward_network_gpu (Darknet::Network &net, float *x, float *y)
 
void forward_network (Darknet::Network &net, Darknet::NetworkState state)
 
void forward_network_gpu (Darknet::Network &net, Darknet::NetworkState state)
 
void free_batch_detections (det_num_pair *det_num_pairs, int n)
 
void free_network (Darknet::Network &net)
 Free all memory allocations for the given neural network.
 
void free_network_recurrent_state (Darknet::Network &net)
 
void fuse_conv_batchnorm (Darknet::Network &net)
 
int get_current_batch (const Darknet::Network &net)
 
int64_t get_current_iteration (const Darknet::Network &net)
 
float get_current_rate (const Darknet::Network &net)
 
float get_current_seq_subdivisions (const Darknet::Network &net)
 
float get_network_cost (const Darknet::Network &net)
 
Darknet::Image get_network_image (Darknet::Network &net)
 
Darknet::Image get_network_image_layer (Darknet::Network &net, int i)
 
int get_network_input_size (Darknet::Network &net)
 
float * get_network_output (Darknet::Network &net)
 
float * get_network_output_gpu (Darknet::Network &net)
 
int get_network_output_size (Darknet::Network &net)
 
int get_sequence_value (const Darknet::Network &net)
 
int is_ema_initialized (const Darknet::Network &net)
 
Darknet::Network make_network (int n)
 Think of this as the constructor for the Darknet::Network object.
 
int network_height (Darknet::Network *net)
 
float * network_predict (Darknet::Network &net, float *input)
 
det_num_pairnetwork_predict_batch (Darknet::Network *net, Darknet::Image im, int batch_size, int w, int h, float thresh, float hier, int *map, int relative, int letter)
 
matrix network_predict_data (Darknet::Network &net, data test)
 
float * network_predict_gpu (Darknet::Network &net, float *input)
 
int network_width (Darknet::Network *net)
 
void optimize_picture (Darknet::Network *net, Darknet::Image orig, int max_layer, float scale, float rate, float thresh, int norm)
 
void reject_similar_weights (Darknet::Network &net, float sim_threshold)
 
int resize_network (Darknet::Network *net, int w, int h)
 
void restore_network_recurrent_state (Darknet::Network &net)
 
void set_batch_network (Darknet::Network *net, int b)
 
void sync_nets (Darknet::Network *nets, int n, int interval)
 
void test_detector (const char *datacfg, const char *cfgfile, const char *weightfile, const char *filename, float thresh, float hier_thresh, int dont_show, int ext_output, int save_labels, const char *outfile, int letter_box, int benchmark_layers)
 
void train_detector (const char *datacfg, const char *cfgfile, const char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map, float thresh, float iou_thresh, int mjpeg_port, int show_imgs, int benchmark_layers, const char *chart_path)
 
float train_network (Darknet::Network &net, data d)
 
float train_network_batch (Darknet::Network &net, data d, int n)
 
float train_network_datum (Darknet::Network &net, float *x, float *y)
 
float train_network_datum_gpu (Darknet::Network &net, float *x, float *y)
 
float train_network_waitkey (Darknet::Network &net, data d, int wait_key)
 
float train_networks (Darknet::Network *nets, int n, data d, int interval)
 
void update_network (Darknet::Network &net)
 
void update_network_gpu (Darknet::Network &net)
 
float validate_detector_map (const char *datacfg, const char *cfgfile, const char *weightfile, float thresh_calc_avg_iou, const float iou_thresh, const int map_points, int letter_box, Darknet::Network *existing_net)
 
void visualize_network (Darknet::Network &net)
 

Function Documentation

◆ backward_network()

void backward_network ( Darknet::Network net,
Darknet::NetworkState  state 
)
Here is the caller graph for this function:

◆ backward_network_gpu()

void backward_network_gpu ( Darknet::Network net,
Darknet::NetworkState  state 
)
Todo:
V3 benchmark layers
Todo:
V3 benchmark layers
Todo:
replace qsort() unknown priority
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_weights_net()

void copy_weights_net ( const Darknet::Network net_train,
Darknet::Network net_map 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ema_apply()

void ema_apply ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ema_update()

void ema_update ( Darknet::Network net,
float  ema_alpha 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_backward_network_gpu()

void forward_backward_network_gpu ( Darknet::Network net,
float *  x,
float *  y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_network()

void forward_network ( Darknet::Network net,
Darknet::NetworkState  state 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_network_gpu()

void forward_network_gpu ( Darknet::Network net,
Darknet::NetworkState  state 
)
Todo:
in previous versions we did not CHECK_CUDA here – was that intentional?
Todo:
V3 benchmark layers
Todo:
V3 benchmark layers
Todo:
replace qsort() low priority
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_batch_detections()

void free_batch_detections ( det_num_pair det_num_pairs,
int  n 
)
Here is the call graph for this function:

◆ free_network()

void free_network ( Darknet::Network net)

Free all memory allocations for the given neural network.

All of these functions perform the exact same task, so use the one that makes the most sense given your application. Some of these are C++ calls, some are C, some pass the network by refrence, some pass a pointer to the neural network.

See also
darknet_free_neural_network()
Darknet::free_neural_network()
free_network_ptr()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_network_recurrent_state()

void free_network_recurrent_state ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuse_conv_batchnorm()

void fuse_conv_batchnorm ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_current_batch()

int get_current_batch ( const Darknet::Network net)
Here is the caller graph for this function:

◆ get_current_iteration()

int64_t get_current_iteration ( const Darknet::Network net)
Here is the caller graph for this function:

◆ get_current_rate()

float get_current_rate ( const Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_current_seq_subdivisions()

float get_current_seq_subdivisions ( const Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_network_cost()

float get_network_cost ( const Darknet::Network net)
Here is the caller graph for this function:

◆ get_network_image()

Darknet::Image get_network_image ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_network_image_layer()

Darknet::Image get_network_image_layer ( Darknet::Network net,
int  i 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_network_input_size()

int get_network_input_size ( Darknet::Network net)
Here is the caller graph for this function:

◆ get_network_output()

float * get_network_output ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_network_output_gpu()

float * get_network_output_gpu ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_network_output_size()

int get_network_output_size ( Darknet::Network net)
Here is the caller graph for this function:

◆ get_sequence_value()

int get_sequence_value ( const Darknet::Network net)
Here is the caller graph for this function:

◆ is_ema_initialized()

int is_ema_initialized ( const Darknet::Network net)
Here is the caller graph for this function:

◆ make_network()

Darknet::Network make_network ( int  n)

Think of this as the constructor for the Darknet::Network object.

Parameters
[in]nThe number of network layers to initialize.
Here is the caller graph for this function:

◆ network_height()

int network_height ( Darknet::Network net)
Here is the caller graph for this function:

◆ network_predict()

float * network_predict ( Darknet::Network net,
float *  input 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ network_predict_batch()

det_num_pair * network_predict_batch ( Darknet::Network net,
Darknet::Image  im,
int  batch_size,
int  w,
int  h,
float  thresh,
float  hier,
int *  map,
int  relative,
int  letter 
)
Here is the call graph for this function:

◆ network_predict_data()

matrix network_predict_data ( Darknet::Network net,
data  test 
)
Here is the call graph for this function:

◆ network_predict_gpu()

float * network_predict_gpu ( Darknet::Network net,
float *  input 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ network_width()

int network_width ( Darknet::Network net)
Here is the caller graph for this function:

◆ optimize_picture()

void optimize_picture ( Darknet::Network net,
Darknet::Image  orig,
int  max_layer,
float  scale,
float  rate,
float  thresh,
int  norm 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reject_similar_weights()

void reject_similar_weights ( Darknet::Network net,
float  sim_threshold 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize_network()

int resize_network ( Darknet::Network net,
int  w,
int  h 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ restore_network_recurrent_state()

void restore_network_recurrent_state ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_batch_network()

void set_batch_network ( Darknet::Network net,
int  b 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sync_nets()

void sync_nets ( Darknet::Network nets,
int  n,
int  interval 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_detector()

void test_detector ( const char *  datacfg,
const char *  cfgfile,
const char *  weightfile,
const char *  filename,
float  thresh,
float  hier_thresh,
int  dont_show,
int  ext_output,
int  save_labels,
const char *  outfile,
int  letter_box,
int  benchmark_layers 
)
Here is the caller graph for this function:

◆ train_detector()

void train_detector ( const char *  datacfg,
const char *  cfgfile,
const char *  weightfile,
int *  gpus,
int  ngpus,
int  clear,
int  dont_show,
int  calc_map,
float  thresh,
float  iou_thresh,
int  mjpeg_port,
int  show_imgs,
int  benchmark_layers,
const char *  chart_path 
)
Todo:
copy the weights...?
Here is the caller graph for this function:

◆ train_network()

float train_network ( Darknet::Network net,
data  d 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ train_network_batch()

float train_network_batch ( Darknet::Network net,
data  d,
int  n 
)

◆ train_network_datum()

float train_network_datum ( Darknet::Network net,
float *  x,
float *  y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ train_network_datum_gpu()

float train_network_datum_gpu ( Darknet::Network net,
float *  x,
float *  y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ train_network_waitkey()

float train_network_waitkey ( Darknet::Network net,
data  d,
int  wait_key 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ train_networks()

float train_networks ( Darknet::Network nets,
int  n,
data  d,
int  interval 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_network()

void update_network ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_network_gpu()

void update_network_gpu ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_detector_map()

float validate_detector_map ( const char *  datacfg,
const char *  cfgfile,
const char *  weightfile,
float  thresh_calc_avg_iou,
const float  iou_thresh,
const int  map_points,
int  letter_box,
Darknet::Network existing_net 
)
Todo:
how many cores do we have available?
Todo:
I think this is TP + FN (where the object actually exists, and we either found it, or missed it)
Todo:
would we save anything if net was passed in by reference?
Here is the caller graph for this function:

◆ visualize_network()

void visualize_network ( Darknet::Network net)
Here is the call graph for this function:
Here is the caller graph for this function: