MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / Add_Padding

Function Add_Padding

dataload/loader.py:18–22  ·  view source on GitHub ↗
(image, top, bottom, left, right, color=(255,255,255))

Source from the content-addressed store, hash-verified

16from utils.label2tensor import strLabelConverter
17
18def Add_Padding(image, top, bottom, left, right, color=(255,255,255)):
19 if(not isinstance(image,np.ndarray)):
20 image = np.array(image)
21 padded_image = cv2.copyMakeBorder(image, top, bottom,left, right, cv2.BORDER_CONSTANT, value=color)
22 return padded_image
23
24def fixkeyCh(key):
25 return ''.join(re.findall("[㙟\u4e00-\u9fa50-9a-zA-Z#%().·-]",key))

Callers 1

__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected