| | |
| | | h = constrain(0, 1, h); |
| | | if (w < .01 || h < .01) continue; |
| | | if(1){ |
| | | //w = sqrt(w); |
| | | //h = sqrt(h); |
| | | w = pow(w, 1./2.); |
| | | h = pow(h, 1./2.); |
| | | } |
| | |
| | | |
| | | int flip = rand_r(&data_seed)%2; |
| | | image cropped = crop_image(orig, pleft, ptop, swidth, sheight); |
| | | |
| | | float dx = ((float)pleft/ow)/sx; |
| | | float dy = ((float)ptop /oh)/sy; |
| | | |
| | | free_image(orig); |
| | | image sized = resize_image(cropped, w, h); |
| | | free_image(cropped); |
| | | if(flip) flip_image(sized); |
| | | d.X.vals[i] = sized.data; |
| | | |
| | | fill_truth_detection(random_paths[i], d.y.vals[i], classes, num_boxes, flip, background, dx, dy, 1./sx, 1./sy); |
| | | |
| | | free_image(orig); |
| | | free_image(cropped); |
| | | } |
| | | free(random_paths); |
| | | return d; |