|
@@ -24,19 +24,19 @@ class AnnotationType(BaseChoiceType):
|
|
Default = FILE_LIST
|
|
Default = FILE_LIST
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
- def new_annotation(cls, opts: AnnotationArgs, **kwargs):
|
|
|
|
- info_file = read_info_file(opts.data)
|
|
|
|
- ds_info = info_file.DATASETS[opts.dataset]
|
|
|
|
|
|
+ def new_annotation(cls, args: AnnotationArgs, **kwargs):
|
|
|
|
+ info_file = read_info_file(args.data)
|
|
|
|
+ ds_info = info_file.DATASETS[args.dataset]
|
|
|
|
|
|
- if opts.dataset in cls:
|
|
|
|
- annot = cls[opts.dataset].value
|
|
|
|
|
|
+ if args.dataset in cls:
|
|
|
|
+ annot = cls[args.dataset].value
|
|
|
|
|
|
else:
|
|
else:
|
|
- assert opts.dataset in info_file.DATASETS, \
|
|
|
|
|
|
+ assert args.dataset in info_file.DATASETS, \
|
|
f"No information was found about the dataset \"{opts.dataset}\" in the info file \"{opts.data}\""
|
|
f"No information was found about the dataset \"{opts.dataset}\" in the info file \"{opts.data}\""
|
|
annot = cls[ds_info.annotation_type.lower()].value
|
|
annot = cls[ds_info.annotation_type.lower()].value
|
|
|
|
|
|
- return annot.new(opts, ds_info=ds_info, **kwargs)
|
|
|
|
|
|
+ return annot.new(args, ds_info=ds_info, **kwargs)
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def as_choices(cls, add_phony=True):
|
|
def as_choices(cls, add_phony=True):
|