派生自 Algorithm/baseDetector

Scheaven
2021-06-03 168af40fe9a3cc81c6ee16b3e81f154780c36bdb
lib/detecter_tools/darknet/darknet.h
@@ -104,7 +104,7 @@
// activations.h
typedef enum {
    LOGISTIC, RELU, RELU6, RELIE, LINEAR, RAMP, TANH, PLSE, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN, SELU, GELU, SWISH, MISH, NORM_CHAN, NORM_CHAN_SOFTMAX, NORM_CHAN_SOFTMAX_MAXVAL
    LOGISTIC, RELU, RELU6, RELIE, LINEAR, RAMP, TANH, PLSE, REVLEAKY, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN, SELU, GELU, SWISH, MISH, HARD_MISH, NORM_CHAN, NORM_CHAN_SOFTMAX, NORM_CHAN_SOFTMAX_MAXVAL
}ACTIVATION;
// parser.h
@@ -142,6 +142,16 @@
    MULT, ADD, SUB, DIV
} BINARY_ACTIVATION;
// blas.h
typedef struct contrastive_params {
    float sim;
    float exp_sim;
    float P;
    int i, j;
    int time_step_i, time_step_j;
} contrastive_params;
// layer.h
typedef enum {
    CONVOLUTIONAL,
@@ -166,6 +176,7 @@
    GRU,
    LSTM,
    CONV_LSTM,
    HISTORY,
    CRNN,
    BATCHNORM,
    NETWORK,
@@ -180,7 +191,9 @@
    LOGXENT,
    L2NORM,
    EMPTY,
    BLANK
    BLANK,
    CONTRASTIVE,
    IMPLICIT
} LAYER_TYPE;
// layer.h
@@ -205,6 +218,7 @@
struct layer {
    LAYER_TYPE type;
    ACTIVATION activation;
    ACTIVATION lstm_activation;
    COST_TYPE cost_type;
    void(*forward)   (struct layer, struct network_state);
    void(*backward)  (struct layer, struct network_state);
@@ -232,6 +246,7 @@
    int out_h, out_w, out_c;
    int n;
    int max_boxes;
    int truth_size;
    int groups;
    int group_id;
    int size;
@@ -242,8 +257,10 @@
    int dilation;
    int antialiasing;
    int maxpool_depth;
    int maxpool_zero_nonmax;
    int out_channels;
    int reverse;
    float reverse;
    int coordconv;
    int flatten;
    int spatial;
    int pad;
@@ -258,6 +275,9 @@
    int keep_delta_gpu;
    int optimized_memory;
    int steps;
    int history_size;
    int bottleneck;
    float time_normalizer;
    int state_constrain;
    int hidden;
    int truth;
@@ -284,6 +304,15 @@
    int noloss;
    int softmax;
    int classes;
    int detection;
    int embedding_layer_id;
    float *embedding_output;
    int embedding_size;
    float sim_thresh;
    int track_history_size;
    int dets_for_track;
    int dets_for_show;
    float track_ciou_norm;
    int coords;
    int background;
    int rescore;
@@ -360,6 +389,13 @@
    float ** sums;
    float * rand;
    float * cost;
    int *labels;
    int *class_ids;
    int contrastive_neg_max;
    float *cos_sim;
    float *exp_cos_sim;
    float *p_constrastive;
    contrastive_params *contrast_p_gpu;
    float * state;
    float * prev_state;
    float * forgot_state;
@@ -379,15 +415,23 @@
    float *scales;
    float *scale_updates;
    float *weights_ema;
    float *biases_ema;
    float *scales_ema;
    float *weights;
    float *weight_updates;
    float scale_x_y;
    int objectness_smooth;
    int new_coords;
    int show_details;
    float max_delta;
    float uc_normalizer;
    float iou_normalizer;
    float obj_normalizer;
    float cls_normalizer;
    float delta_normalizer;
    IOU_LOSS iou_loss;
    IOU_LOSS iou_thresh_kind;
    NMS_KIND nms_kind;
@@ -514,10 +558,15 @@
//#ifdef GPU
    int *indexes_gpu;
    int stream;
    int wait_stream_id;
    float *z_gpu;
    float *r_gpu;
    float *h_gpu;
    float *stored_h_gpu;
    float *bottelneck_hi_gpu;
    float *bottelneck_delta_gpu;
    float *temp_gpu;
    float *temp2_gpu;
@@ -602,6 +651,7 @@
    float * activation_input_gpu;
    float * loss_gpu;
    float * delta_gpu;
    float * cos_sim_gpu;
    float * rand_gpu;
    float * drop_blocks_scale;
    float * drop_blocks_scale_gpu;
@@ -655,6 +705,15 @@
    int n;
    int batch;
    uint64_t *seen;
    float *badlabels_reject_threshold;
    float *delta_rolling_max;
    float *delta_rolling_avg;
    float *delta_rolling_std;
    int weights_reject_freq;
    int equidistant_point;
    float badlabels_rejection_percentage;
    float num_sigmas_reject_badlabels;
    float ema_alpha;
    int *cur_iteration;
    float loss_scale;
    int *t;
@@ -664,6 +723,8 @@
    float *output;
    learning_rate_policy policy;
    int benchmark_layers;
    int *total_bbox;
    int *rewritten_bbox;
    float learning_rate;
    float learning_rate_min;
@@ -711,7 +772,13 @@
    int attention;
    int adversarial;    
    float adversarial_lr;
    float max_chart_loss;
    int letter_box;
    int mosaic_bound;
    int contrastive;
    int contrastive_jit_flip;
    int contrastive_color;
    int unsupervised;
    float angle;
    float aspect;
    float exposure;
@@ -754,6 +821,11 @@
    size_t *max_input16_size;
    size_t *max_output16_size;
    int wait_stream;
    void *cuda_graph;
    void *cuda_graph_exec;
    int use_cuda_graph;
    int *cuda_graph_ready;
    float *global_delta_gpu;
    float *state_delta_gpu;
@@ -833,6 +905,10 @@
    int sort_class;
    float *uc; // Gaussian_YOLOv3 - tx,ty,tw,th uncertainty
    int points; // bit-0 - center, bit-1 - top-left-corner, bit-2 - bottom-right-corner
    float *embeddings;  // embeddings for tracking
    int embedding_size;
    float sim;
    int track_id;
} detection;
// network.c -batch inference
@@ -878,6 +954,7 @@
    int nh;
    int nw;
    int num_boxes;
    int truth_size;
    int min, max, size;
    int classes;
    int background;
@@ -888,8 +965,12 @@
    int track;
    int augment_speed;
    int letter_box;
    int mosaic_bound;
    int show_imgs;
    int dontuse_opencv;
    int contrastive;
    int contrastive_jit_flip;
    int contrastive_color;
    float jitter;
    float resize;
    int flip;
@@ -912,6 +993,7 @@
// data.h
typedef struct box_label {
    int id;
    int track_id;
    float x, y, w, h;
    float left, right, top, bottom;
} box_label;
@@ -929,7 +1011,6 @@
//    node *front;
//    node *back;
//} list;
// -----------------------------------------------------
@@ -938,6 +1019,7 @@
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 void free_network(network net);
LIB_API void free_network_ptr(network* net);
// network.c
LIB_API load_args get_base_args(network *net);
@@ -1025,6 +1107,10 @@
void stop_timer_and_show_name(char *name);
void show_total_time();
LIB_API void set_track_id(detection *new_dets, int new_dets_num, float thresh, float sim_thresh, float track_ciou_norm, int deque_size, int dets_for_track, int dets_for_show);
LIB_API int fill_remaining_id(detection *new_dets, int new_dets_num, int new_track_id, float thresh);
// gemm.h
LIB_API void init_cpu();