@ -123,8 +123,8 @@ void cortexProcessingUnit::load_data_blocking(cortexTHREAD_ARGS *args){
} ;
} ;
void cortexProcessingUnit : : print_letters ( float * pred , size _t n ) {
for ( size _t i = 0 ; i < n ; + + i ) {
void cortexProcessingUnit : : print_letters ( float * pred , uint32 _t n ) {
for ( uint32 _t i = 0 ; i < n ; + + i ) {
int index = 0 ; // max_index(pred + i*NUMCHARS, NUMCHARS);
printf ( " %c " , int_to_alphanum ( index ) ) ;
}
@ -172,7 +172,7 @@ cortexMATRIX cortexProcessingUnit::concat_matrix(cortexMATRIX m1, cortexMATRIX m
return m ;
} ;
//cortexDATA load_data_captcha( cortexList *paths, int m, int k, int w, int h)
cortexDATA * cortexProcessingUnit : : load_data_captcha ( cortexList * paths , size_t n , size_t m , size_t k , size_t w , size _t h ) {
cortexDATA * cortexProcessingUnit : : load_data_captcha ( cortexList * paths , uint32_t n , uint32_t m , uint32_t k , uint32_t w , uint32 _t h ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -196,7 +196,7 @@ cortexDATA *cortexProcessingUnit::load_data_captcha(cortexList *paths, size_t n,
} ;
//cortexDATA load_data_captcha_encode(cortexList *paths, int m, int w, int h)
cortexDATA * cortexProcessingUnit : : load_data_captcha_encode ( cortexList * paths , size_t n , size_t m , size_t w , size _t h ) {
cortexDATA * cortexProcessingUnit : : load_data_captcha_encode ( cortexList * paths , uint32_t n , uint32_t m , uint32_t w , uint32 _t h ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -215,7 +215,7 @@ cortexDATA *cortexProcessingUnit::load_data_captcha_encode(cortexList *paths, si
} ;
//cortexDATA *load_data_detection(cortexList *paths, int m, int w, int h, int boxes, int classes, float jitter, float hue, float saturation, float exposure)
cortexDATA * cortexProcessingUnit : : load_data_detection ( cortexList * paths , size_t n , size_t m , size_t w , size_t h , size_t boxes , size _t classes , float jitter , float hue , float saturation , float exposure ) {
cortexDATA * cortexProcessingUnit : : load_data_detection ( cortexList * paths , uint32_t n , uint32_t m , uint32_t w , uint32_t h , uint32_t boxes , uint32 _t classes , float jitter , float hue , float saturation , float exposure ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -278,7 +278,7 @@ cortexDATA *cortexProcessingUnit::load_data_detection(cortexList *paths, size_t
} ;
//cortexDATA *load_data_old(cortexList *paths, int m, cortexList *labels, int w, int h)
cortexDATA * cortexProcessingUnit : : load_data_old ( cortexList * paths , cortexList * labels , size_t w , size _t h ) {
cortexDATA * cortexProcessingUnit : : load_data_old ( cortexList * paths , cortexList * labels , uint32_t w , uint32 _t h ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -295,7 +295,7 @@ cortexDATA *cortexProcessingUnit::load_data_old(cortexList *paths, cortexList *l
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_tag ( cortexList * paths , size_t k , size_t min , size_t max , size _t size , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexDATA * cortexProcessingUnit : : load_data_tag ( cortexList * paths , uint32_t k , uint32_t min , uint32_t max , uint32 _t size , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -317,7 +317,7 @@ cortexDATA *cortexProcessingUnit::load_data_tag(cortexList *paths, size_t k, siz
return d ;
} ;
cortexMATRIX * cortexProcessingUnit : : load_image_augment_paths ( cortexList * paths , size_t min , size_t max , size _t size , float angle , float aspect , float hue , float saturation , float exposure , size _t center ) {
cortexMATRIX * cortexProcessingUnit : : load_image_augment_paths ( cortexList * paths , uint32_t min , uint32_t max , uint32 _t size , float angle , float aspect , float hue , float saturation , float exposure , uint32 _t center ) {
cortexMATRIX * X ;
int i ;
X = ( cortexMATRIX * ) malloc ( sizeof ( cortexMATRIX ) ) ;
@ -351,7 +351,7 @@ cortexMATRIX *cortexProcessingUnit::load_image_augment_paths(cortexList *paths,
return X ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_super ( cortexList * paths , size_t w , size_t h , size _t scale ) {
cortexDATA * cortexProcessingUnit : : load_data_super ( cortexList * paths , uint32_t w , uint32_t h , uint32 _t scale ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -397,7 +397,7 @@ cortexDATA *cortexProcessingUnit::load_data_super(cortexList *paths, size_t w, s
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_augment ( cortexList * paths , cortexList * labels , cortexTREE * hierarchy , size_t min , size_t max , size _t size , float angle , float aspect , float hue , float saturation , float exposure , size _t center ) {
cortexDATA * cortexProcessingUnit : : load_data_augment ( cortexList * paths , cortexList * labels , cortexTREE * hierarchy , uint32_t min , uint32_t max , uint32 _t size , float angle , float aspect , float hue , float saturation , float exposure , uint32 _t center ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -417,7 +417,7 @@ cortexDATA *cortexProcessingUnit::load_data_augment(cortexList *paths, cortexLis
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_regression ( cortexList * paths , size_t min , size_t max , size _t size , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexDATA * cortexProcessingUnit : : load_data_regression ( cortexList * paths , uint32_t min , uint32_t max , uint32 _t size , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -489,7 +489,7 @@ cortexDATA *cortexProcessingUnit::load_go(char *filename){
fclose ( fp ) ;
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_writing ( cortexList * paths , size_t w , size_t h , size_t out_w , size _t out_h ) {
cortexDATA * cortexProcessingUnit : : load_data_writing ( cortexList * paths , uint32_t w , uint32_t h , uint32_t out_w , uint32 _t out_h ) {
cortexList * random_paths = get_random_paths ( paths ) ;
cortexList * replace_paths = find_replace_paths ( random_paths , " .png " , " -label.png " ) ;
cortexDATA * d = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
@ -503,7 +503,7 @@ cortexDATA *cortexProcessingUnit::load_data_writing(cortexList *paths, size_t w,
return d ;
} ;
void cortexProcessingUnit : : get_random_batch ( cortexDATA * d , size _t n , float * X , float * Y ) {
void cortexProcessingUnit : : get_random_batch ( cortexDATA * d , uint32 _t n , float * X , float * Y ) {
for ( uint32_t j = 0 ; j < n ; + + j ) {
int index = rand ( ) % d - > X . rows ;
memcpy ( X + j * d - > X . cols , d - > X . values [ index ] , d - > X . cols * sizeof ( float ) ) ;
@ -511,7 +511,7 @@ void cortexProcessingUnit::get_random_batch(cortexDATA *d, size_t n, float *X, f
} ;
} ;
cortexDATA * cortexProcessingUnit : : get_data_part ( cortexDATA * d , size_t part , size _t total ) {
cortexDATA * cortexProcessingUnit : : get_data_part ( cortexDATA * d , uint32_t part , uint32 _t total ) {
cortexDATA * p = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( p ! = NULL ) {
memset ( p , 0 , sizeof ( cortexDATA ) ) ;
@ -525,7 +525,7 @@ cortexDATA *cortexProcessingUnit::get_data_part(cortexDATA *d, size_t part, size
} ;
return p ;
} ;
cortexDATA * cortexProcessingUnit : : get_random_data ( cortexDATA * d , size _t num ) {
cortexDATA * cortexProcessingUnit : : get_random_data ( cortexDATA * d , uint32 _t num ) {
cortexDATA * r = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( r ! = NULL ) {
memset ( r , 0 , sizeof ( cortexDATA ) ) ;
@ -549,7 +549,7 @@ cortexDATA *cortexProcessingUnit::get_random_data(cortexDATA *d, size_t num){
return r ;
} ;
cortexDATA * cortexProcessingUnit : : load_categorical_data_csv ( char * filename , size_t target , size _t k ) {
cortexDATA * cortexProcessingUnit : : load_categorical_data_csv ( char * filename , uint32_t target , uint32 _t k ) {
cortexDATA * d ;
d = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( d ! = NULL ) {
@ -577,7 +577,7 @@ void cortexProcessingUnit::translate_data_rows(cortexDATA *d, float s){
} ;
void cortexProcessingUnit : : randomize_data ( cortexDATA * d ) {
} ;
cortexDATA * * cortexProcessingUnit : : split_data ( cortexDATA * d , size_t part , size _t total ) {
cortexDATA * * cortexProcessingUnit : : split_data ( cortexDATA * d , uint32_t part , uint32 _t total ) {
cortexDATA * * split = ( cortexDATA * * ) calloc ( 2 , sizeof ( cortexDATA * ) ) ;
if ( split ! = NULL ) {
cortexDATA * train = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
@ -594,8 +594,8 @@ cortexDATA **cortexProcessingUnit::split_data(cortexDATA *d, size_t part, size_t
memset ( train , 0 , sizeof ( cortexDATA ) ) ;
memset ( test , 0 , sizeof ( cortexDATA ) ) ;
size _t start = part * d - > X . rows / total ;
size _t end = ( part + 1 ) * d - > X . rows / total ;
uint32 _t start = part * d - > X . rows / total ;
uint32 _t end = ( part + 1 ) * d - > X . rows / total ;
train - > bShallow = test - > bShallow = true ;
@ -640,7 +640,7 @@ cortexDATA *cortexProcessingUnit::concat_data(cortexDATA *d1, cortexDATA *d2){
return out ;
} ;
cortexDATA * cortexProcessingUnit : : concat_datas ( cortexDATA * d , size _t n ) {
cortexDATA * cortexProcessingUnit : : concat_datas ( cortexDATA * d , uint32 _t n ) {
cortexDATA * out ;
out = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( out ! = NULL ) {
@ -673,13 +673,13 @@ void cortexProcessingUnit::fill_truth(char *path, cortexList *labels, /*size_t k
# endif
} ;
cortexList * cortexProcessingUnit : : get_random_paths ( cortexList * paths , size _t limit ) {
cortexList * cortexProcessingUnit : : get_random_paths ( cortexList * paths , uint32 _t limit ) {
cortexList * mList ;
mList = new cortexList ( ) ;
if ( mList ! = NULL ) {
//MUTEX_LOCK(mutex);
//mList->assign(paths->size(), NULL);
if ( limit = = 0 | | limit > paths - > size ( ) ) limit = paths - > size ( ) ;
if ( limit = = 0 | | limit > ( uint32_t ) paths - > size ( ) ) limit = ( uint32_t ) paths - > size ( ) ;
for ( cortexList : : iterator index = paths - > begin ( ) ; index < paths - > end ( ) ; index + + ) mList - > push_back ( * index ) ;
std : : random_shuffle ( mList - > begin ( ) , mList - > end ( ) ) ;
//MUTEX_UNLOCK(&mutex);
@ -700,7 +700,7 @@ cortexList *cortexProcessingUnit::find_replace_paths(cortexList *paths, char *fi
return mList ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_compare ( cortexList * paths , size_t classes , size_t w , size_t h , size _t limit ) {
cortexDATA * cortexProcessingUnit : : load_data_compare ( cortexList * paths , uint32_t classes , uint32_t w , uint32_t h , uint32 _t limit ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths , 2 * limit ) ; // get_random_paths(paths, 2 * n, m);
@ -710,16 +710,16 @@ cortexDATA *cortexProcessingUnit::load_data_compare(cortexList *paths, size_t cl
} ;
d = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( d ! = NULL ) {
size _t i , j ;
size _t n ;
n = random_paths - > size ( ) > > 1 ;
uint32 _t i , j ;
uint32 _t n ;
n = ( ( uint32_t ) random_paths - > size ( ) ) > > 1 ;
memset ( d , 0 , sizeof ( cortexDATA ) ) ;
d - > bShallow = false ;
d - > X . rows = n ;
d - > X . values = ( float * * ) calloc ( d - > X . rows , sizeof ( float * ) ) ;
d - > X . cols = h * w * 6 ;
int k = 2 * ( classes ) ;
u int32_ t k = 2 * ( classes ) ;
d - > Y = make_matrix ( n , k ) ;
for ( i = 0 ; i < n ; + + i ) {
cortexImage im1 ;
@ -774,7 +774,7 @@ cortexDATA *cortexProcessingUnit::load_data_compare(cortexList *paths, size_t cl
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_seg ( cortexList * paths , size_t w , size_t h , size_t classes , size_t min , size _t max , float angle , float aspect , float hue , float saturation , float exposure , bool div ) {
cortexDATA * cortexProcessingUnit : : load_data_seg ( cortexList * paths , uint32_t w , uint32_t h , uint32_t classes , uint32_t min , uint32 _t max , float angle , float aspect , float hue , float saturation , float exposure , bool div ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -791,7 +791,7 @@ cortexDATA *cortexProcessingUnit::load_data_seg(cortexList *paths, size_t w, siz
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_iseg ( cortexList * paths , size_t w , size_t h , size_t classes , size_t boxes , size_t coords , size_t min , size _t max , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexDATA * cortexProcessingUnit : : load_data_iseg ( cortexList * paths , uint32_t w , uint32_t h , uint32_t classes , uint32_t boxes , uint32_t coords , uint32_t min , uint32 _t max , float angle , float aspect , float hue , float saturation , float exposure ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -808,7 +808,7 @@ cortexDATA *cortexProcessingUnit::load_data_iseg(cortexList *paths, size_t w, si
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_region ( cortexList * paths , size_t w , size_t h , size_t size , size _t classes , float jitter , float hue , float saturation , float exposure ) {
cortexDATA * cortexProcessingUnit : : load_data_region ( cortexList * paths , uint32_t w , uint32_t h , uint32_t size , uint32 _t classes , float jitter , float hue , float saturation , float exposure ) {
cortexList * random_paths ;
cortexDATA * d ;
random_paths = get_random_paths ( paths ) ;
@ -824,7 +824,7 @@ cortexDATA *cortexProcessingUnit::load_data_region(cortexList *paths, size_t w,
free_cortexList ( paths ) ;
return d ;
} ;
cortexDATA * cortexProcessingUnit : : load_data_swag ( cortexList * paths , size _t classes , float jitter ) {
cortexDATA * cortexProcessingUnit : : load_data_swag ( cortexList * paths , uint32 _t classes , float jitter ) {
cortexDATA * d ;
d = ( cortexDATA * ) malloc ( sizeof ( cortexDATA ) ) ;
if ( d ! = NULL ) {
@ -916,7 +916,7 @@ cortexMATRIX cortexProcessingUnit::load_labels_paths(cortexList *paths, cortexLi
return y ;
} ;
cortexMATRIX cortexProcessingUnit : : load_tags_paths ( cortexList * paths , size _t k ) {
cortexMATRIX cortexProcessingUnit : : load_tags_paths ( cortexList * paths , uint32 _t k ) {
cortexMATRIX y = make_matrix ( ( uint32_t ) paths - > size ( ) , k ) ;
int i ;
int count = 0 ;
@ -932,7 +932,7 @@ cortexMATRIX cortexProcessingUnit::load_tags_paths(cortexList *paths, size_t k){
if ( ! file ) continue ;
}
+ + count ;
size _t tag ;
uint32 _t tag ;
while ( fscanf ( file , " %d " , & tag ) = = 1 ) {
if ( tag < k ) {
y . values [ i ] [ tag ] = 1 ;
@ -940,11 +940,11 @@ cortexMATRIX cortexProcessingUnit::load_tags_paths(cortexList *paths, size_t k){
} ;
fclose ( file ) ;
} ;
printf ( " %d/%d \n " , count , paths - > size ( ) ) ;
printf ( " %d/%d \n " , count , ( uint32_t ) paths - > size ( ) ) ;
return y ;
} ;
void cortexProcessingUnit : : fill_truth_swag ( char * path , float * truth , size _t classes , float dx , float dy , float sx , float sy , bool flip ) {
void cortexProcessingUnit : : fill_truth_swag ( char * path , float * truth , uint32 _t classes , float dx , float dy , float sx , float sy , bool flip ) {
char labelpath [ 4096 ] ;
find_replace ( path , " images " , " labels " , labelpath ) ;
find_replace ( labelpath , " JPEGImages " , " labels " , labelpath ) ;
@ -952,12 +952,12 @@ void cortexProcessingUnit::fill_truth_swag(char *path, float *truth, size_t clas
find_replace ( labelpath , " .JPG " , " .txt " , labelpath ) ;
find_replace ( labelpath , " .JPEG " , " .txt " , labelpath ) ;
size _t count = 0 ;
uint32 _t count = 0 ;
cortexBOXLABEL * boxes = read_boxes ( labelpath , & count ) ;
randomize_boxes ( boxes , count ) ;
correct_boxes ( boxes , count , dx , dy , sx , sy , flip ) ;
float x , y , w , h ;
size _t i , id ;
uint32 _t i , id ;
for ( i = 0 ; i < count & & i < 30 ; + + i ) {
x = boxes [ i ] . x ;
@ -980,7 +980,7 @@ void cortexProcessingUnit::fill_truth_swag(char *path, float *truth, size_t clas
free ( boxes ) ;
} ;
void cortexProcessingUnit : : fill_hierarchy ( float * truth , size _t k , cortexTREE * hierarchy ) {
void cortexProcessingUnit : : fill_hierarchy ( float * truth , uint32 _t k , cortexTREE * hierarchy ) {
for ( size_t j = 0 ; j < k ; + + j ) {
if ( truth [ j ] ) {
uint32_t parent = hierarchy - > parent [ j ] ;
@ -1008,7 +1008,7 @@ void cortexProcessingUnit::fill_hierarchy(float *truth, size_t k, cortexTREE *hi
count + = hierarchy - > group_size [ j ] ;
} ;
} ;
void cortexProcessingUnit : : fill_truth_captcha ( char * path , size _t n , float * truth ) {
void cortexProcessingUnit : : fill_truth_captcha ( char * path , uint32 _t n , float * truth ) {
char * begin = strrchr ( path , ' / ' ) ;
+ + begin ;
size_t i ;
@ -1021,7 +1021,7 @@ void cortexProcessingUnit::fill_truth_captcha(char *path, size_t n, float *truth
truth [ i * NUMCHARS + NUMCHARS - 1 ] = 1 ;
} ;
} ;
void cortexProcessingUnit : : fill_truth_detection ( char * path , size _t num_boxes , float * truth , size _t classes , bool flip , float dx , float dy , float sx , float sy ) {
void cortexProcessingUnit : : fill_truth_detection ( char * path , uint32 _t num_boxes , float * truth , uint32 _t classes , bool flip , float dx , float dy , float sx , float sy ) {
char labelpath [ 4096 ] ;
find_replace ( path , " images " , " labels " , labelpath ) ;
find_replace ( labelpath , " JPEGImages " , " labels " , labelpath ) ;
@ -1031,7 +1031,7 @@ void cortexProcessingUnit::fill_truth_detection(char *path, size_t num_boxes, fl
find_replace ( labelpath , " .png " , " .txt " , labelpath ) ;
find_replace ( labelpath , " .JPG " , " .txt " , labelpath ) ;
find_replace ( labelpath , " .JPEG " , " .txt " , labelpath ) ;
size _t count = 0 ;
uint32 _t count = 0 ;
cortexBOXLABEL * boxes = read_boxes ( labelpath , & count ) ;
randomize_boxes ( boxes , count ) ;
correct_boxes ( boxes , count , dx , dy , sx , sy , flip ) ;
@ -1057,9 +1057,9 @@ void cortexProcessingUnit::fill_truth_detection(char *path, size_t num_boxes, fl
free ( boxes ) ;
} ;
cortexMATRIX cortexProcessingUnit : : load_image_paths_gray ( cortexList * paths , size_t w , size _t h ) {
cortexMATRIX cortexProcessingUnit : : load_image_paths_gray ( cortexList * paths , uint32_t w , uint32 _t h ) {
cortexMATRIX X ;
int i ;
u int32_ t i ;
X . rows = ( uint32_t ) paths - > size ( ) ;
X . values = ( float * * ) calloc ( X . rows , sizeof ( float * ) ) ;
X . cols = 0 ;
@ -1076,9 +1076,9 @@ cortexMATRIX cortexProcessingUnit::load_image_paths_gray(cortexList *paths, size
return X ;
} ;
cortexMATRIX cortexProcessingUnit : : load_image_paths ( cortexList * paths , size_t w , size _t h ) {
cortexMATRIX cortexProcessingUnit : : load_image_paths ( cortexList * paths , uint32_t w , uint32 _t h ) {
cortexMATRIX X ;
int i ;
u int32_ t i ;
X . rows = ( uint32_t ) paths - > size ( ) ;
X . values = ( float * * ) calloc ( X . rows , sizeof ( float * ) ) ;
X . cols = 0 ;
@ -1094,13 +1094,13 @@ cortexMATRIX cortexProcessingUnit::load_image_paths(cortexList *paths, size_t w,
return X ;
} ;
cortexBOXLABEL * cortexProcessingUnit : : read_boxes ( char * filename , size _t * n ) {
cortexBOXLABEL * cortexProcessingUnit : : read_boxes ( char * filename , uint32 _t * n ) {
cortexBOXLABEL * boxes = ( cortexBOXLABEL * ) calloc ( 1 , sizeof ( cortexBOXLABEL ) ) ;
FILE * file = fopen ( filename , " r " ) ;
if ( ! file ) return NULL ;
float x , y , h , w ;
int id ;
int count = 0 ;
u int32_ t id ;
u int32_ t count = 0 ;
while ( fscanf ( file , " %d %f %f %f %f " , & id , & x , & y , & w , & h ) = = 5 ) {
boxes = ( cortexBOXLABEL * ) realloc ( boxes , ( count + 1 ) * sizeof ( cortexBOXLABEL ) ) ;
boxes [ count ] . id = id ;
@ -1119,8 +1119,8 @@ cortexBOXLABEL *cortexProcessingUnit::read_boxes(char *filename, size_t *n){
return boxes ;
} ;
void cortexProcessingUnit : : randomize_boxes ( cortexBOXLABEL * b , size _t n ) {
for ( size _t i = 0 ; i < n ; + + i ) {
void cortexProcessingUnit : : randomize_boxes ( cortexBOXLABEL * b , uint32 _t n ) {
for ( uint32 _t i = 0 ; i < n ; + + i ) {
cortexBOXLABEL swap = b [ i ] ;
int index = rand ( ) % n ;
b [ i ] = b [ index ] ;
@ -1128,8 +1128,8 @@ void cortexProcessingUnit::randomize_boxes(cortexBOXLABEL *b, size_t n){
} ;
} ;
void cortexProcessingUnit : : correct_boxes ( cortexBOXLABEL * boxes , size _t n , float dx , float dy , float sx , float sy , bool flip ) {
for ( size _t i = 0 ; i < n ; + + i ) {
void cortexProcessingUnit : : correct_boxes ( cortexBOXLABEL * boxes , uint32 _t n , float dx , float dy , float sx , float sy , bool flip ) {
for ( uint32 _t i = 0 ; i < n ; + + i ) {
if ( boxes [ i ] . x = = 0 & & boxes [ i ] . y = = 0 ) {
boxes [ i ] . x = 999999 ;
boxes [ i ] . y = 999999 ;