(path, order='RGB')
| 10 | import torch.distributed as dist |
| 11 | |
| 12 | def load_img(path, order='RGB'): |
| 13 | img = cv2.imread(path, cv2.IMREAD_COLOR | cv2.IMREAD_IGNORE_ORIENTATION) |
| 14 | if not isinstance(img, np.ndarray): |
| 15 | raise IOError('Fail to read %s' % path) |
| 16 | |
| 17 | if order == 'RGB': |
| 18 | img = img[:, :, ::-1].copy() |
| 19 | |
| 20 | img = img.astype(np.float32) |
| 21 | return img |
| 22 | |
| 23 | |
| 24 | def get_bbox(joint_img, joint_valid, extend_ratio=1.2): |
no test coverage detected