tumourkit.segmentation.hovernet.misc.patch_extractor.PatchExtractor
- class tumourkit.segmentation.hovernet.misc.patch_extractor.PatchExtractor(win_size, step_size, debug=False)
Bases:
objectExtractor to generate patches with or without padding. Turn on debug mode to see how it is done.
- Args:
x : input image, should be of shape HWC win_size : a tuple of (h, w) step_size : a tuple of (h, w) debug : flag to see how it is done
- Return:
a list of sub patches, each patch has dtype same as x
- Examples:
>>> xtractor = PatchExtractor((450, 450), (120, 120)) >>> img = np.full([1200, 1200, 3], 255, np.uint8) >>> patches = xtractor.extract(img, 'mirror')
Methods
extract