From 1b5afb45838e603fa6780762eb8cc59246dc2d81 Mon Sep 17 00:00:00 2001
From: IlyaOvodov <b@ovdv.ru>
Date: Tue, 08 May 2018 11:09:35 +0000
Subject: [PATCH] Output improvements for detector results: When printing detector results, output was done in random order, obfuscating results for interpreting. Now: 1. Text output includes coordinates of rects in (left,right,top,bottom in pixels) along with label and score 2. Text output is sorted by rect lefts to simplify finding appropriate rects on image 3. If several class probs are > thresh for some detection, the most probable is written first and coordinates for others are not repeated 4. Rects are imprinted in image in order by their best class prob, so most probable rects are always on top and not overlayed by less probable ones 5. Most probable label for rect is always written first Also: 6. Message about low GPU memory include required amount

---
 src/network.h |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 4 deletions(-)

diff --git a/src/network.h b/src/network.h
index 66ceb30..fe160a9 100644
--- a/src/network.h
+++ b/src/network.h
@@ -2,18 +2,26 @@
 #ifndef NETWORK_H
 #define NETWORK_H
 
-#include "image.h"
+#include <stdint.h>
 #include "layer.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "image.h"
 #include "data.h"
+#include "tree.h"
 
 typedef enum {
-    CONSTANT, STEP, EXP, POLY, STEPS, SIG
+    CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM
 } learning_rate_policy;
 
 typedef struct network{
+    float *workspace;
     int n;
     int batch;
-    int *seen;
+	int *seen;
     float epoch;
     int subdivisions;
     float momentum;
@@ -33,15 +41,36 @@
     float *scales;
     int   *steps;
     int num_steps;
+    int burn_in;
+
+    int adam;
+    float B1;
+    float B2;
+    float eps;
 
     int inputs;
     int h, w, c;
     int max_crop;
     int min_crop;
+    int flip; // horizontal flip 50% probability augmentaiont for classifier training (default = 1)
+    float angle;
+    float aspect;
+    float exposure;
+    float saturation;
+    float hue;
+	int small_object;
+
+    int gpu_index;
+    tree *hierarchy;
 
     #ifdef GPU
     float **input_gpu;
     float **truth_gpu;
+	float **input16_gpu;
+	float **output16_gpu;
+	size_t *max_input16_size;
+	size_t *max_output16_size;
+	int wait_stream;
     #endif
 } network;
 
@@ -49,12 +78,15 @@
     float *truth;
     float *input;
     float *delta;
+    float *workspace;
     int train;
     int index;
     network net;
 } network_state;
 
 #ifdef GPU
+float train_networks(network *nets, int n, data d, int interval);
+void sync_nets(network *nets, int n, int interval);
 float train_network_datum_gpu(network net, float *x, float *y);
 float *network_predict_gpu(network net, float *input);
 float * get_network_output_gpu_layer(network net, int i);
@@ -82,7 +114,7 @@
 float train_network_datum(network net, float *x, float *y);
 
 matrix network_predict_data(network net, data test);
-float *network_predict(network net, float *input);
+YOLODLL_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);
@@ -102,9 +134,23 @@
 void set_batch_network(network *net, int b);
 int get_network_input_size(network net);
 float get_network_cost(network net);
+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(char *cfg, char *weights, int clear);
+YOLODLL_API float *network_predict_image(network *net, image im);
+YOLODLL_API void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show);
+YOLODLL_API int network_width(network *net);
+YOLODLL_API int network_height(network *net);
 
 int get_network_nuisance(network net);
 int get_network_background(network net);
+void fuse_conv_batchnorm(network net);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif
 

--
Gitblit v1.10.0