|
|
|
@ -39,17 +39,6 @@ char **get_random_paths_indexes(char **paths, int n, int m, int *indexes) |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
inline unsigned int random_gen() |
|
|
|
|
{ |
|
|
|
|
unsigned int Num = 0; |
|
|
|
|
#ifdef WIN32 |
|
|
|
|
rand_s(&Num); |
|
|
|
|
#else |
|
|
|
|
Num = rand(); |
|
|
|
|
#endif |
|
|
|
|
return Num; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char **get_random_paths(char **paths, int n, int m) |
|
|
|
|
{ |
|
|
|
|
char **random_paths = calloc(n, sizeof(char*)); |
|
|
|
@ -693,10 +682,10 @@ data load_data_detection(int n, char **paths, int m, int w, int h, int boxes, in |
|
|
|
|
int dw = (ow*jitter); |
|
|
|
|
int dh = (oh*jitter); |
|
|
|
|
|
|
|
|
|
int pleft = rand_uniform(-dw, dw); |
|
|
|
|
int pright = rand_uniform(-dw, dw); |
|
|
|
|
int ptop = rand_uniform(-dh, dh); |
|
|
|
|
int pbot = rand_uniform(-dh, dh); |
|
|
|
|
int pleft = rand_uniform_strong(-dw, dw); |
|
|
|
|
int pright = rand_uniform_strong(-dw, dw); |
|
|
|
|
int ptop = rand_uniform_strong(-dh, dh); |
|
|
|
|
int pbot = rand_uniform_strong(-dh, dh); |
|
|
|
|
|
|
|
|
|
int swidth = ow - pleft - pright; |
|
|
|
|
int sheight = oh - ptop - pbot; |
|
|
|
@ -727,7 +716,7 @@ data load_data_detection(int n, char **paths, int m, int w, int h, int boxes, in |
|
|
|
|
|
|
|
|
|
void *load_thread(void *ptr) |
|
|
|
|
{ |
|
|
|
|
srand(time(0)); |
|
|
|
|
//srand(time(0));
|
|
|
|
|
//printf("Loading data: %d\n", random_gen());
|
|
|
|
|
load_args a = *(struct load_args*)ptr; |
|
|
|
|
if(a.exposure == 0) a.exposure = 1; |
|
|
|
@ -771,7 +760,7 @@ pthread_t load_data_in_thread(load_args args) |
|
|
|
|
|
|
|
|
|
void *load_threads(void *ptr) |
|
|
|
|
{ |
|
|
|
|
srand(time(0)); |
|
|
|
|
//srand(time(0));
|
|
|
|
|
int i; |
|
|
|
|
load_args args = *(load_args *)ptr; |
|
|
|
|
if (args.threads == 0) args.threads = 1; |
|
|
|
|