darwin.importer packageο
Subpackagesο
- darwin.importer.formats package
- Submodules
- darwin.importer.formats.coco module
- darwin.importer.formats.csv_tags module
- darwin.importer.formats.csv_tags_video module
- darwin.importer.formats.darwin module
- darwin.importer.formats.dataloop module
- darwin.importer.formats.labelbox module
- darwin.importer.formats.labelbox_schemas module
- darwin.importer.formats.nifti module
- darwin.importer.formats.nifti_schemas module
- darwin.importer.formats.pascal_voc module
- darwin.importer.formats.superannotate module
- darwin.importer.formats.superannotate_schemas module
- Module contents
Submodulesο
darwin.importer.importer moduleο
- darwin.importer.importer.import_annotations(dataset: RemoteDataset, importer: Callable[[Path], List[AnnotationFile] | AnnotationFile | None], file_paths: List[str | Path], append: bool, class_prompt: bool = True, delete_for_empty: bool = False, import_annotators: bool = False, import_reviewers: bool = False, overwrite: bool = False, use_multi_cpu: bool = False, cpu_limit: int | None = None) None[source]ο
Imports the given given Annotations into the given Dataset. :param dataset: Dataset where the Annotations will be imported to. :type dataset: RemoteDataset :param importer: Parsing module containing the logic to parse the given Annotation files given in
files_path. Seeimporter/formatfor a list of out of supported parsers.- Parameters:
file_paths (List[PathLike]) β A list of
Pathβs or strings containing the Annotations we wish to import.append (bool) β If
Trueappends the given annotations to the datasets. IfFalsewill override them. Incompatible withdelete-for-empty.class_prompt (bool) β If
Falseclasses will be created and added to the datasets without requiring a userβs prompt.delete_for_empty (bool, default: False) β If
Truewill use empty annotation files to delete all annotations from the remote file. IfFalse, empty annotation files will simply be skipped. Only works for V2 datasets. Incompatible withappend.import_annotators (bool, default: False) β If
Trueit will import the annotators from the files to the dataset, if available. IfFalseit will not import the annotators.import_reviewers (bool, default: False) β If
Trueit will import the reviewers from the files to the dataset, if . IfFalseit will not import the reviewers.overwrite (bool, default: False) β If
Trueit will bypass a warning that the import will overwrite the current annotations if any are present. IfFalsethis warning will be skipped and the import will overwrite the current annotations without warning.use_multi_cpu (bool, default: True) β If
Truewill use multiple available CPU cores to parse the annotation files. IfFalsewill use only the current Python process, which runs in one core. Processing using multiple cores is faster, but may slow down a machine also running other processes. Processing with one core is slower, but will run well alongside other processes.cpu_limit (int, default: 2 less than total cpu count) β The maximum number of CPU cores to use when
use_multi_cpuisTrue. Ifcpu_limitis greater than the number of available CPU cores, it will be set to the number of available cores. Ifcpu_limitis less than 1, it will be set to CPU count - 2. Ifcpu_limitis omitted, it will be set to CPU count - 2.
- Raises:
ValueError β
If
file_pathsis not a list. - If the application is unable to fetch any remote classes. - If the application was unable to find/parse any annotation files. - If the application was unable to fetch remote file list.
If both
appendanddelete_for_emptyare specified asTrue.
Module contentsο
- darwin.importer.get_importer(format: str) Callable[[Path], List[AnnotationFile] | AnnotationFile | None][source]ο