MCPcopy Create free account
hub / github.com/aigc3d/LHM / preproc

Function preproc

engine/BiRefNet/image_proc.py:41–52  ·  view source on GitHub ↗
(image, label, preproc_methods=['flip'])

Source from the content-addressed store, hash-verified

39
40
41def preproc(image, label, preproc_methods=['flip']):
42 if 'flip' in preproc_methods:
43 image, label = cv_random_flip(image, label)
44 if 'crop' in preproc_methods:
45 image, label = random_crop(image, label)
46 if 'rotate' in preproc_methods:
47 image, label = random_rotate(image, label)
48 if 'enhance' in preproc_methods:
49 image = color_enhance(image)
50 if 'pepper' in preproc_methods:
51 image = random_pepper(image)
52 return image, label
53
54
55def cv_random_flip(img, label):

Callers 1

__getitem__Method · 0.85

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