Parcourir la source

moved Opts class to cvdatasets module

Dimitri Korsch il y a 3 ans
Parent
commit
331c685acf

+ 2 - 2
cvfinetune/finetuner/mixins/base.py

@@ -63,9 +63,9 @@ if __name__ == '__main__':
 			return str(self.__dict__)
 
 
-	Opts = namedtuple("Opts", "foo foo2 bar bar2 beef1")
+	_Opts = namedtuple("_Opts", "foo foo2 bar bar2 beef1")
 
-	opts = Opts(1,2,3, -4, "hat")
+	opts = _Opts(1,2,3, -4, "hat")
 	kwargs = Final.extract_kwargs(opts)
 
 	print(opts, Final(**kwargs))

+ 2 - 4
cvfinetune/finetuner/mixins/dataset.py

@@ -2,14 +2,12 @@ import abc
 import logging
 import typing as T
 
-from collections import namedtuple
 from cvdatasets import AnnotationType
+from cvdatasets import AnnotationArgs
 from cvdatasets.dataset.image import Size
 
 from cvfinetune.finetuner.mixins.base import BaseMixin
 
-Opts = namedtuple("Opts", "data dataset parts feature_model")
-
 class _DatasetMixin(BaseMixin):
     """
         This mixin is responsible for annotation loading and for
@@ -55,7 +53,7 @@ class _DatasetMixin(BaseMixin):
             Reads annotations and creates annotation instance,
             which holds important infos about the dataset
         """
-        opts = Opts(
+        opts = AnnotationArgs(
             self.info_file,
             self.dataset_name,
             self.part_type,