MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / load_img

Function load_img

util/preprocessing.py:12–21  ·  view source on GitHub ↗
(path, order='RGB')

Source from the content-addressed store, hash-verified

10import torch.distributed as dist
11
12def 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
24def get_bbox(joint_img, joint_valid, extend_ratio=1.2):

Callers 7

__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90
__getitem__Method · 0.90

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected