| | |
| | | float dh = (y - j*box_height)/box_height; |
| | | //printf("%d %d %d %f %f\n", id, i, j, dh, dw); |
| | | int index = (i+j*num_width)*(4+classes); |
| | | if(truth[index+classes]) continue; |
| | | truth[index+id] = 1; |
| | | index += classes; |
| | | truth[index++] = dh; |
| | |
| | | return d; |
| | | } |
| | | |
| | | data load_data_captcha_encode(char **paths, int n, int m, int h, int w) |
| | | { |
| | | if(m) paths = get_random_paths(paths, n, m); |
| | | data d; |
| | | d.shallow = 0; |
| | | d.X = load_image_paths(paths, n, h, w); |
| | | d.y = d.X; |
| | | if(m) free(paths); |
| | | return d; |
| | | } |
| | | |
| | | void fill_truth(char *path, char **labels, int k, float *truth) |
| | | { |
| | |
| | | |
| | | void *load_detection_thread(void *ptr) |
| | | { |
| | | printf("Loading data: %d\n", rand()); |
| | | struct load_args a = *(struct load_args*)ptr; |
| | | *a.d = load_data_detection_jitter_random(a.n, a.paths, a.m, a.classes, a.h, a.w, a.nh, a.nw, a.jitter); |
| | | translate_data_rows(*a.d, -128); |