Esempio n. 1
0
    def __init__(
        self,
        train_transform: Optional[Union[Dict[str, Callable]]] = None,
        val_transform: Optional[Union[Dict[str, Callable]]] = None,
        test_transform: Optional[Union[Dict[str, Callable]]] = None,
        predict_transform: Optional[Union[Dict[str, Callable]]] = None,
        image_size: int = 256,
    ):
        if val_transform:
            raise_not_supported("validation")
        if test_transform:
            raise_not_supported("test")

        if isinstance(image_size, int):
            image_size = (image_size, image_size)

        self.image_size = image_size

        super().__init__(
            train_transform=train_transform,
            val_transform=val_transform,
            test_transform=test_transform,
            predict_transform=predict_transform,
            data_sources={
                DefaultDataSources.FILES: ImagePathsDataSource(),
                DefaultDataSources.FOLDERS: ImagePathsDataSource(),
                DefaultDataSources.NUMPY: ImageNumpyDataSource(),
                DefaultDataSources.TENSORS: ImageTensorDataSource(),
                DefaultDataSources.TENSORS: ImageTensorDataSource(),
            },
            default_data_source=DefaultDataSources.FILES,
        )
Esempio n. 2
0
 def __init__(
     self,
     train_transform: Optional[Dict[str, Callable]] = None,
     val_transform: Optional[Dict[str, Callable]] = None,
     test_transform: Optional[Dict[str, Callable]] = None,
     predict_transform: Optional[Dict[str, Callable]] = None,
     **data_source_kwargs: Any,
 ):
     super().__init__(
         train_transform=train_transform,
         val_transform=val_transform,
         test_transform=test_transform,
         predict_transform=predict_transform,
         data_sources={
             DefaultDataSources.FIFTYONE:
             ObjectDetectionFiftyOneDataSource(**data_source_kwargs),
             DefaultDataSources.FILES:
             ImagePathsDataSource(),
             DefaultDataSources.FOLDERS:
             ImagePathsDataSource(),
             "coco":
             COCODataSource(),
         },
         default_data_source=DefaultDataSources.FILES,
     )
Esempio n. 3
0
    def __init__(
        self,
        train_transform: Optional[Dict[str, Callable]] = None,
        val_transform: Optional[Dict[str, Callable]] = None,
        test_transform: Optional[Dict[str, Callable]] = None,
        predict_transform: Optional[Dict[str, Callable]] = None,
        image_size: Tuple[int, int] = (196, 196),
        deserializer: Optional[Deserializer] = None,
        **data_source_kwargs: Any,
    ):
        self.image_size = image_size

        super().__init__(
            train_transform=train_transform,
            val_transform=val_transform,
            test_transform=test_transform,
            predict_transform=predict_transform,
            data_sources={
                DefaultDataSources.FIFTYONE: ImageFiftyOneDataSource(**data_source_kwargs),
                DefaultDataSources.FILES: ImagePathsDataSource(),
                DefaultDataSources.FOLDERS: ImagePathsDataSource(),
                DefaultDataSources.NUMPY: ImageNumpyDataSource(),
                DefaultDataSources.TENSORS: ImageTensorDataSource(),
            },
            deserializer=deserializer or ImageClassificationDeserializer(),
            default_data_source=DefaultDataSources.FILES,
        )
Esempio n. 4
0
 def __init__(
     self,
     train_transform: Optional[Dict[str, Callable]] = None,
     val_transform: Optional[Dict[str, Callable]] = None,
     test_transform: Optional[Dict[str, Callable]] = None,
     predict_transform: Optional[Dict[str, Callable]] = None,
 ):
     super().__init__(
         train_transform=train_transform,
         val_transform=val_transform,
         test_transform=test_transform,
         predict_transform=predict_transform,
         data_sources={
             DefaultDataSources.FILES: ImagePathsDataSource(),
             DefaultDataSources.FOLDERS: ImagePathsDataSource(),
             "coco": COCODataSource(),
         },
         default_data_source=DefaultDataSources.FILES,
     )
Esempio n. 5
0
    def __init__(
            self,
            train_transform: Optional[Dict[str, Callable]] = None,
            val_transform: Optional[Dict[str, Callable]] = None,
            test_transform: Optional[Dict[str, Callable]] = None,
            predict_transform: Optional[Dict[str, Callable]] = None,
            image_size: Tuple[int, int] = (196, 196),
    ):
        self.image_size = image_size

        super().__init__(
            train_transform=train_transform,
            val_transform=val_transform,
            test_transform=test_transform,
            predict_transform=predict_transform,
            data_sources={
                DefaultDataSources.FILES: ImagePathsDataSource(),
                DefaultDataSources.FOLDERS: ImagePathsDataSource(),
                DefaultDataSources.NUMPY: ImageNumpyDataSource(),
                DefaultDataSources.TENSORS: ImageTensorDataSource(),
            },
            default_data_source=DefaultDataSources.FILES,
        )