@@ -95,6 +95,7 @@ def download_annotations(self, dest_dir: Path):
9595 log_message ("Downloading annotations from repository" )
9696 repoApi = self .ds .source .repoApi
9797 if self .annotations_type == "cvat" :
98+ # Download just the annotation file
9899 repoApi .download (self .annotations_file .as_posix (), dest_dir , keep_source_prefix = True )
99100 elif self .annotations_type == "yolo" :
100101 # Download the dataset .yaml file and the images + annotations
@@ -107,6 +108,7 @@ def download_annotations(self, dest_dir: Path):
107108 assert context .path is not None
108109 repoApi .download (self .annotations_file .parent / context .path , dest_dir , keep_source_prefix = True )
109110 elif self .annotations_type == "coco" :
111+ # Download just the annotation file
110112 repoApi .download (self .annotations_file .as_posix (), dest_dir , keep_source_prefix = True )
111113
112114 @staticmethod
@@ -157,10 +159,8 @@ def remap_annotations(
157159 )
158160 continue
159161 for ann in anns :
160- if ann .filename is not None :
161- ann .filename = remap_func (ann .filename )
162- else :
163- ann .filename = new_filename
162+ assert ann .filename is not None
163+ ann .filename = remap_func (ann .filename )
164164 remapped [new_filename ] = anns
165165
166166 return remapped
0 commit comments