2013-11-13 22:50:38 +04:00
|
|
|
#ifndef DATA_H
|
|
|
|
#define DATA_H
|
2014-12-12 00:15:26 +03:00
|
|
|
#include <pthread.h>
|
2013-11-13 22:50:38 +04:00
|
|
|
|
2017-06-02 06:31:13 +03:00
|
|
|
#include "darknet.h"
|
2013-12-07 01:26:09 +04:00
|
|
|
#include "matrix.h"
|
2014-02-15 04:09:07 +04:00
|
|
|
#include "list.h"
|
2015-06-16 09:22:44 +03:00
|
|
|
#include "image.h"
|
2016-10-21 23:16:43 +03:00
|
|
|
#include "tree.h"
|
2013-11-13 22:50:38 +04:00
|
|
|
|
2015-04-01 20:25:50 +03:00
|
|
|
static inline float distance_from_edge(int x, int max)
|
|
|
|
{
|
|
|
|
int dx = (max/2) - x;
|
|
|
|
if (dx < 0) dx = -dx;
|
|
|
|
dx = (max/2) + 1 - dx;
|
|
|
|
dx *= 2;
|
|
|
|
float dist = (float)dx/max;
|
|
|
|
if (dist > 1) dist = 1;
|
|
|
|
return dist;
|
|
|
|
}
|
2017-05-28 07:41:55 +03:00
|
|
|
void load_data_blocking(load_args args);
|
2016-09-20 21:34:49 +03:00
|
|
|
|
2015-08-25 04:27:42 +03:00
|
|
|
|
2015-02-24 05:52:05 +03:00
|
|
|
void print_letters(float *pred, int n);
|
2015-04-10 01:18:54 +03:00
|
|
|
data load_data_captcha(char **paths, int n, int m, int k, int w, int h);
|
|
|
|
data load_data_captcha_encode(char **paths, int n, int m, int w, int h);
|
2016-09-02 02:48:41 +03:00
|
|
|
data load_data_detection(int n, char **paths, int m, int w, int h, int boxes, int classes, float jitter, float hue, float saturation, float exposure);
|
2016-09-08 08:27:56 +03:00
|
|
|
data load_data_tag(char **paths, int n, int m, int k, int min, int max, int size, float angle, float aspect, float hue, float saturation, float exposure);
|
2017-04-13 00:22:53 +03:00
|
|
|
matrix load_image_augment_paths(char **paths, int n, int min, int max, int size, float angle, float aspect, float hue, float saturation, float exposure, int center);
|
2016-08-06 01:27:07 +03:00
|
|
|
data load_data_super(char **paths, int n, int m, int w, int h, int scale);
|
2017-04-13 00:22:53 +03:00
|
|
|
data load_data_augment(char **paths, int n, int m, char **labels, int k, tree *hierarchy, int min, int max, int size, float angle, float aspect, float hue, float saturation, float exposure, int center);
|
2018-01-23 05:09:36 +03:00
|
|
|
data load_data_regression(char **paths, int n, int m, int classes, int min, int max, int size, float angle, float aspect, float hue, float saturation, float exposure);
|
2016-03-14 09:18:42 +03:00
|
|
|
data load_go(char *filename);
|
2014-12-28 20:42:35 +03:00
|
|
|
|
2015-04-10 01:18:54 +03:00
|
|
|
|
2015-09-24 00:13:43 +03:00
|
|
|
data load_data_writing(char **paths, int n, int m, int w, int h, int out_w, int out_h);
|
2015-05-25 21:53:10 +03:00
|
|
|
|
2014-10-28 05:45:06 +03:00
|
|
|
void get_random_batch(data d, int n, float *X, float *y);
|
2016-09-20 21:34:49 +03:00
|
|
|
data get_data_part(data d, int part, int total);
|
2016-03-14 09:18:42 +03:00
|
|
|
data get_random_data(data d, int num);
|
2013-12-07 01:26:09 +04:00
|
|
|
data load_categorical_data_csv(char *filename, int target, int k);
|
|
|
|
void normalize_data_rows(data d);
|
2014-02-14 22:26:31 +04:00
|
|
|
void scale_data_rows(data d, float s);
|
2014-07-14 09:07:51 +04:00
|
|
|
void translate_data_rows(data d, float s);
|
2013-12-07 01:26:09 +04:00
|
|
|
void randomize_data(data d);
|
2013-12-07 21:38:50 +04:00
|
|
|
data *split_data(data d, int part, int total);
|
2016-08-06 01:27:07 +03:00
|
|
|
data concat_datas(data *d, int n);
|
2016-05-07 02:25:16 +03:00
|
|
|
void fill_truth(char *path, char **labels, int k, float *truth);
|
2013-11-13 22:50:38 +04:00
|
|
|
|
|
|
|
#endif
|