Sorted bounding boxes from Detection
| 1054 | |
| 1055 | |
| 1056 | class SortedBoxes(object): |
| 1057 | """ |
| 1058 | Sorted bounding boxes from Detection |
| 1059 | """ |
| 1060 | |
| 1061 | def __init__(self): |
| 1062 | pass |
| 1063 | |
| 1064 | def __call__(self, dt_boxes): |
| 1065 | num_boxes = dt_boxes.shape[0] |
| 1066 | sorted_boxes = sorted(dt_boxes, key=lambda x: (x[0][1], x[0][0])) |
| 1067 | _boxes = list(sorted_boxes) |
| 1068 | for i in range(num_boxes - 1): |
| 1069 | if abs(_boxes[i+1][0][1] - _boxes[i][0][1]) < 10 and \ |
| 1070 | (_boxes[i + 1][0][0] < _boxes[i][0][0]): |
| 1071 | tmp = _boxes[i] |
| 1072 | _boxes[i] = _boxes[i + 1] |
| 1073 | _boxes[i + 1] = tmp |
| 1074 | return _boxes |
| 1075 | |
| 1076 | |
| 1077 | class GetRotateCropImage(object): |
no outgoing calls
no test coverage detected