MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / apply_image

Method apply_image

PATH/core/data/transforms/seg_aug_dev.py:286–296  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

284 self._set_attributes(locals())
285
286 def apply_image(self, img):
287 if img.ndim == 3:
288 padding = ((self.y0, self.y1), (self.x0, self.x1), (0, 0))
289 else:
290 padding = ((self.y0, self.y1), (self.x0, self.x1))
291 return np.pad(
292 img,
293 padding,
294 mode="constant",
295 constant_values=self.pad_value,
296 )
297
298 def apply_segmentation(self, img):
299 if img.ndim == 3:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected