@@ -25,12 +25,12 @@ def __init__(
2525 ):
2626 """Initializes an Annotaions object.
2727
28- Args:
29- dataset_object (Dataset): Datumaro Dataset Object.
30- annotation_format (str): The format of the dataset.
31- task (str): The task of the dataset.
28+ Args:
29+ dataset_object (Dataset): Datumaro Dataset Object.
30+ annotation_format (str): The format of the dataset.
31+ task (str): The task of the dataset.
3232
33- """
33+ """
3434 self ._dataset = dataset_object
3535 self .annotation_format = annotation_format
3636 self .task = task
@@ -39,17 +39,17 @@ def __init__(
3939 def import_from (cls , path : str , format : str ) -> Dataset :
4040 """Imports a dataset from a given path and format.
4141
42- Args:
43- path (str): The path to the dataset.
44- format (str): The format of the dataset.
42+ Args:
43+ path (str): The path to the dataset.
44+ format (str): The format of the dataset.
4545
46- Returns:
47- A dataset object.
46+ Returns:
47+ A dataset object.
4848
49- Example:
50- >>> from clarifai_utils import ImageAnnotations
51- >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
52- """
49+ Example:
50+ >>> from clarifai_utils import ImageAnnotations
51+ >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
52+ """
5353 if format not in IMAGE_ANNOTATION_FORMATS :
5454 raise AnnotationsFormatError (
5555 'Invalid format. Format must be one of {}' .format (IMAGE_ANNOTATION_FORMATS ))
@@ -67,14 +67,14 @@ def import_from(cls, path: str, format: str) -> Dataset:
6767 def get_info (self ,) -> Dict [str , Any ]:
6868 """Gets information about a dataset.
6969
70- Returns:
71- A dictionary containing the information about the dataset.
70+ Returns:
71+ A dictionary containing the information about the dataset.
7272
73- Example:
74- >>> from clarifai_utils import ImageAnnotations
75- >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
76- >>> info = format.get_info()
77- """
73+ Example:
74+ >>> from clarifai_utils import ImageAnnotations
75+ >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
76+ >>> info = format.get_info()
77+ """
7878 return {
7979 'size' : len (self ._dataset ._data ),
8080 'source_path' : self ._dataset ._source_path ,
@@ -87,15 +87,15 @@ def get_info(self,) -> Dict[str, Any]:
8787 def export_to (self , path : str , format : str ) -> None :
8888 """Exports a dataset to a given path and format.
8989
90- Args:
91- path (str): The path to the dataset.
92- format (str): The format of the dataset.
90+ Args:
91+ path (str): The path to the dataset.
92+ format (str): The format of the dataset.
9393
94- Example:
95- >>> from clarifai_utils import ImageAnnotations
96- >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
97- >>> format.export_to(path=output_folder_path, format = 'voc_detection')
98- """
94+ Example:
95+ >>> from clarifai_utils import ImageAnnotations
96+ >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
97+ >>> format.export_to(path=output_folder_path, format = 'voc_detection')
98+ """
9999 if format not in IMAGE_ANNOTATION_FORMATS :
100100 raise AnnotationsFormatError ('Invalid format' )
101101
@@ -109,16 +109,16 @@ def export_to(self, path: str, format: str) -> None:
109109 def detect_format (path : str ) -> str :
110110 """Gets the format of a dataset.
111111
112- Args:
113- path (str): The path to the dataset.
112+ Args:
113+ path (str): The path to the dataset.
114114
115- Returns:
116- The format of the dataset.
115+ Returns:
116+ The format of the dataset.
117117
118- Example:
119- >>> from clarifai_utils import ImageAnnotations
120- >>> format = ImageAnnotations.detect_format(path=folder_path)
121- """
118+ Example:
119+ >>> from clarifai_utils import ImageAnnotations
120+ >>> format = ImageAnnotations.detect_format(path=folder_path)
121+ """
122122 try :
123123 dataset_format = Dataset .detect (path )
124124 except MultipleFormatsMatchError as e :
@@ -134,14 +134,14 @@ def detect_format(path: str) -> str:
134134 def dataloader (self ) -> ClarifaiDataLoader :
135135 """Returns a Clarifai Dataloader Object to pass to SDK Dataset Upload Functionality.
136136
137- Returns:
138- A ClarifaiDataloader object.
137+ Returns:
138+ A ClarifaiDataloader object.
139139
140- Example:
141- >>> from clarifai_utils import ImageAnnotations
142- >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
143- >>> clarifai_dataset_loader = format.dataloader
144- """
140+ Example:
141+ >>> from clarifai_utils import ImageAnnotations
142+ >>> format = ImageAnnotations.import_from(path=folder_path, format = 'coco_detection')
143+ >>> clarifai_dataset_loader = format.dataloader
144+ """
145145 if self .task == 'visual_classification' :
146146 return ClassificationDataLoader (self ._dataset )
147147 elif self .task == 'visual_detection' :
0 commit comments