Пример #1
0
 def load(self, f: IO) -> ImageData:
     image_data_json = json.load(f)
     image_data = ImageData.from_json(
         image_data_json) if image_data_json is not None else None
     return {'image_data': image_data}
Пример #2
0
 def get_image_data_from_annot(
         self, image_path: Union[str, Path],
         annot: Union[Path, str, Dict, fsspec.core.OpenFile]) -> ImageData:
     return ImageData.from_json(annot, image_path=image_path)