MCPcopy Create free account
hub / github.com/ZhengPeng7/BiRefNet / preproc

Function preproc

preproc.py:7–18  ·  view source on GitHub ↗
(image, label, preproc_methods=['flip'])

Source from the content-addressed store, hash-verified

5
6
7def preproc(image, label, preproc_methods=['flip']):
8 if 'flip' in preproc_methods:
9 image, label = cv_random_flip(image, label)
10 if 'crop' in preproc_methods:
11 image, label = random_crop(image, label)
12 if 'rotate' in preproc_methods:
13 image, label = random_rotate(image, label)
14 if 'enhance' in preproc_methods:
15 image = color_enhance(image)
16 if 'pepper' in preproc_methods:
17 label = random_pepper(label)
18 return image, label
19
20
21def cv_random_flip(img, label):

Callers 1

__getitem__Method · 0.90

Calls 5

cv_random_flipFunction · 0.85
random_cropFunction · 0.85
random_rotateFunction · 0.85
color_enhanceFunction · 0.85
random_pepperFunction · 0.85

Tested by

no test coverage detected