| | |
| | | { |
| | | int i; |
| | | for(i = 0; i < n; ++i){ |
| | | if(boxes[i].x == 0 && boxes[i].y == 0) { |
| | | boxes[i].x = 999999; |
| | | boxes[i].y = 999999; |
| | | boxes[i].w = 999999; |
| | | boxes[i].h = 999999; |
| | | continue; |
| | | } |
| | | boxes[i].left = boxes[i].left * sx - dx; |
| | | boxes[i].right = boxes[i].right * sx - dx; |
| | | boxes[i].top = boxes[i].top * sy - dy; |
| | |
| | | find_replace(path, "images", "labels", labelpath); |
| | | find_replace(labelpath, "JPEGImages", "labels", labelpath); |
| | | |
| | | find_replace(labelpath, "raw", "labels", labelpath); |
| | | find_replace(labelpath, ".jpg", ".txt", labelpath); |
| | | find_replace(labelpath, ".png", ".txt", labelpath); |
| | | find_replace(labelpath, ".JPG", ".txt", labelpath); |
| | |
| | | h = boxes[i].h; |
| | | id = boxes[i].id; |
| | | |
| | | if (w < .01 || h < .01) continue; |
| | | if ((w < .01 || h < .01)) continue; |
| | | |
| | | truth[i*5+0] = x; |
| | | truth[i*5+1] = y; |