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/utils.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/src/utils.h b/src/utils.h
index 0db16de..8e8e1c7 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -4,12 +4,42 @@
#include <time.h>
#include "list.h"
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ #define snprintf(buf,len, format,...) _snprintf_s(buf, len,len, format, __VA_ARGS__)
+#endif
+
+#define SECRET_NUM -1234
+#define TWO_PI 6.2831853071795864769252866
+
+#ifdef YOLODLL_EXPORTS
+#if defined(_MSC_VER)
+#define YOLODLL_API __declspec(dllexport)
+#else
+#define YOLODLL_API __attribute__((visibility("default")))
+#endif
+#else
+#if defined(_MSC_VER)
+#define YOLODLL_API
+#else
+#define YOLODLL_API
+#endif
+#endif
+
+double what_time_is_it_now();
+int *read_map(char *filename);
+void shuffle(void *arr, size_t n, size_t size);
+void sorta_shuffle(void *arr, size_t n, size_t size, size_t sections);
+YOLODLL_API void free_ptrs(void **ptrs, int n);
char *basecfg(char *cfgfile);
int alphanum_to_int(char c);
char int_to_alphanum(int i);
+int read_int(int fd);
+void write_int(int fd, int n);
void read_all(int fd, char *buffer, size_t bytes);
void write_all(int fd, char *buffer, size_t bytes);
-char *find_replace(char *str, char *orig, char *rep);
+int read_all_fail(int fd, char *buffer, size_t bytes);
+int write_all_fail(int fd, char *buffer, size_t bytes);
+void find_replace(char *str, char *orig, char *rep, char *output);
void error(const char *s);
void malloc_error();
void file_error(char *s);
@@ -27,18 +57,31 @@
void translate_array(float *a, int n, float s);
int max_index(float *a, int n);
float constrain(float min, float max, float a);
+int constrain_int(int a, int min, int max);
float mse_array(float *a, int n);
float rand_normal();
-float rand_uniform();
+size_t rand_size_t();
+float rand_uniform(float min, float max);
+float rand_scale(float s);
+int rand_int(int min, int max);
float sum_array(float *a, int n);
float mean_array(float *a, int n);
+void mean_arrays(float **a, int n, int els, float *avg);
float variance_array(float *a, int n);
float mag_array(float *a, int n);
+float dist_array(float *a, float *b, int n, int sub);
float **one_hot_encode(float *a, int n, int k);
float sec(clock_t clocks);
+int find_int_arg(int argc, char **argv, char *arg, int def);
+float find_float_arg(int argc, char **argv, char *arg, float def);
+int find_arg(int argc, char* argv[], char *arg);
+char *find_char_arg(int argc, char **argv, char *arg, char *def);
+int sample_array(float *a, int n);
+void print_statistics(float *a, int n);
+unsigned int random_gen();
+float random_float();
+float rand_uniform_strong(float min, float max);
+int int_index(int *a, int val, int n);
-typedef struct{
- float x, y, w, h;
-} box;
#endif
--
Gitblit v1.10.0