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

Function get_crop

dataload/dataAug.py:120–135  ·  view source on GitHub ↗

random crop

(image)

Source from the content-addressed store, hash-verified

118
119
120def get_crop(image):
121 """
122 random crop
123 """
124 h, w, _ = image.shape
125 top_min = 1
126 top_max = 5
127 top_crop = int(random.randint(top_min, top_max))
128 top_crop = min(top_crop, h - 1)
129 crop_img = image.copy()
130 ratio = random.randint(0, 1)
131 if ratio:
132 crop_img = crop_img[top_crop:h, :, :]
133 else:
134 crop_img = crop_img[0:h - top_crop, :, :]
135 return crop_img
136
137
138def resizeAug(img, HThresh=25):

Callers 1

warpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected