|
@@ -1,4 +1,5 @@
|
|
|
import logging
|
|
|
+import typing
|
|
|
|
|
|
from cvdatasets.annotation.types.file_list import FileListAnnotations
|
|
|
from cvdatasets.annotation.types.folder_annotations import FolderAnnotations
|
|
@@ -8,6 +9,13 @@ from cvargparse.utils import BaseChoiceType
|
|
|
from cvargparse.utils.enumerations import MetaBaseType
|
|
|
from cvdatasets.utils import read_info_file
|
|
|
|
|
|
+
|
|
|
+class AnnotationArgs(typing.NamedTuple):
|
|
|
+ data: str
|
|
|
+ dataset: str
|
|
|
+ parts: str
|
|
|
+ feature_model: str
|
|
|
+
|
|
|
class AnnotationType(BaseChoiceType):
|
|
|
FOLDER = FolderAnnotations
|
|
|
FILE_LIST = FileListAnnotations
|
|
@@ -16,7 +24,7 @@ class AnnotationType(BaseChoiceType):
|
|
|
Default = FILE_LIST
|
|
|
|
|
|
@classmethod
|
|
|
- def new_annotation(cls, opts, **kwargs):
|
|
|
+ def new_annotation(cls, opts: AnnotationArgs, **kwargs):
|
|
|
info_file = read_info_file(opts.data)
|
|
|
ds_info = info_file.DATASETS[opts.dataset]
|
|
|
|