Added include/darknet.h

This commit is contained in:
AlexeyAB
2019-01-06 23:51:38 +03:00
parent c56931dd75
commit 3ff5084590
30 changed files with 1823 additions and 308 deletions

View File

@ -1,6 +1,7 @@
// Oh boy, why am I about to do this....
#ifndef NETWORK_H
#define NETWORK_H
#include "darknet.h"
#include <stdint.h>
#include "layer.h"
@ -13,6 +14,7 @@ extern "C" {
#include "data.h"
#include "tree.h"
/*
typedef enum {
CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM
} learning_rate_policy;
@ -77,6 +79,7 @@ typedef struct network{
#endif
} network;
typedef struct network_state {
float *truth;
float *input;
@ -86,6 +89,7 @@ typedef struct network_state {
int index;
network net;
} network_state;
*/
#ifdef GPU
float train_networks(network *nets, int n, data d, int interval);
@ -117,7 +121,7 @@ float train_network_sgd(network net, data d, int n);
float train_network_datum(network net, float *x, float *y);
matrix network_predict_data(network net, data test);
YOLODLL_API float *network_predict(network net, float *input);
//LIB_API float *network_predict(network net, float *input);
float network_accuracy(network net, data d);
float *network_accuracies(network net, data d, int n);
float network_accuracy_multi(network net, data d, int n);
@ -137,25 +141,24 @@ int resize_network(network *net, int w, int h);
void set_batch_network(network *net, int b);
int get_network_input_size(network net);
float get_network_cost(network net);
YOLODLL_API layer* get_network_layer(network* net, int i);
YOLODLL_API detection *get_network_boxes(network *net, int w, int h, float thresh, float hier, int *map, int relative, int *num, int letter);
YOLODLL_API detection *make_network_boxes(network *net, float thresh, int *num);
YOLODLL_API void free_detections(detection *dets, int n);
YOLODLL_API void reset_rnn(network *net);
YOLODLL_API network *load_network_custom(char *cfg, char *weights, int clear, int batch);
YOLODLL_API network *load_network(char *cfg, char *weights, int clear);
YOLODLL_API float *network_predict_image(network *net, image im);
YOLODLL_API float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, float thresh_calc_avg_iou, const float iou_thresh, network *existing_net);
YOLODLL_API void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map);
YOLODLL_API int network_width(network *net);
YOLODLL_API int network_height(network *net);
YOLODLL_API void optimize_picture(network *net, image orig, int max_layer, float scale, float rate, float thresh, int norm);
//LIB_API layer* get_network_layer(network* net, int i);
//LIB_API detection *get_network_boxes(network *net, int w, int h, float thresh, float hier, int *map, int relative, int *num, int letter);
//LIB_API detection *make_network_boxes(network *net, float thresh, int *num);
//LIB_API void free_detections(detection *dets, int n);
//LIB_API void reset_rnn(network *net);
//LIB_API network *load_network_custom(char *cfg, char *weights, int clear, int batch);
//LIB_API network *load_network(char *cfg, char *weights, int clear);
//LIB_API float *network_predict_image(network *net, image im);
//LIB_API float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, float thresh_calc_avg_iou, const float iou_thresh, network *existing_net);
//LIB_API void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map);
//LIB_API int network_width(network *net);
//LIB_API int network_height(network *net);
//LIB_API void optimize_picture(network *net, image orig, int max_layer, float scale, float rate, float thresh, int norm);
int get_network_nuisance(network net);
int get_network_background(network net);
YOLODLL_API void fuse_conv_batchnorm(network net);
YOLODLL_API void calculate_binary_weights(network net);
//LIB_API void fuse_conv_batchnorm(network net);
//LIB_API void calculate_binary_weights(network net);
network combine_train_valid_networks(network net_train, network net_map);
#ifdef __cplusplus