Created
October 20, 2022 08:20
-
-
Save farukcankaya/ef92f67f9fc71c7c23a9e3d0e873f6ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Transform: | |
@abstractmethod | |
def apply_image(self, img: np.ndarray): | |
@abstractmethod | |
def apply_coords(self, coords: np.ndarray): | |
def apply_segmentation(self, segmentation: np.ndarray) -> np.ndarray: | |
return self.apply_image(segmentation) | |
def apply_box(self, box: np.ndarray) -> np.ndarray: | |
... | |
return trans_boxes | |
def apply_polygons(self, polygons: list) -> list: | |
return [self.apply_coords(p) for p in polygons] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment