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/format
for 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
True
appends the given annotations to the datasets. IfFalse
will override them. Incompatible withdelete-for-empty
.class_prompt (bool) β If
False
classes will be created and added to the datasets without requiring a userβs prompt.delete_for_empty (bool, default: False) β If
True
will 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
True
it will import the annotators from the files to the dataset, if available. IfFalse
it will not import the annotators.import_reviewers (bool, default: False) β If
True
it will import the reviewers from the files to the dataset, if . IfFalse
it will not import the reviewers.overwrite (bool, default: False) β If
True
it will bypass a warning that the import will overwrite the current annotations if any are present. IfFalse
this warning will be skipped and the import will overwrite the current annotations without warning.use_multi_cpu (bool, default: True) β If
True
will use multiple available CPU cores to parse the annotation files. IfFalse
will 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_cpu
isTrue
. Ifcpu_limit
is greater than the number of available CPU cores, it will be set to the number of available cores. Ifcpu_limit
is less than 1, it will be set to CPU count - 2. Ifcpu_limit
is omitted, it will be set to CPU count - 2.
- Raises:
ValueError β
If
file_paths
is 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
append
anddelete_for_empty
are specified asTrue
.
Module contentsο
- darwin.importer.get_importer(format: str) Callable[[Path], List[AnnotationFile] | AnnotationFile | None] [source]ο