|
|
@@ -1,7 +1,6 @@
|
|
|
import abc
|
|
|
import logging
|
|
|
|
|
|
-from chainer_addons.models import PrepareType
|
|
|
from cvdatasets import AnnotationType
|
|
|
from cvdatasets.dataset.image import Size
|
|
|
from cvdatasets.utils import new_iterator
|
|
|
@@ -56,7 +55,7 @@ class _DatasetMixin(abc.ABC):
|
|
|
return ds
|
|
|
|
|
|
|
|
|
- def init_annotations(self, opts):
|
|
|
+ def read_annotations(self, opts):
|
|
|
"""Reads annotations and creates annotation instance, which holds important infos about the dataset"""
|
|
|
|
|
|
self.annot = AnnotationType.new_annotation(opts, load_strict=False)
|
|
|
@@ -69,16 +68,6 @@ class _DatasetMixin(abc.ABC):
|
|
|
part_size = getattr(opts, "parts_input_size", None)
|
|
|
part_size = size if part_size is None else Size(part_size)
|
|
|
|
|
|
- self.prepare = partial(PrepareType[opts.prepare_type](self.model),
|
|
|
- swap_channels=opts.swap_channels,
|
|
|
- keep_ratio=getattr(opts, "center_crop_on_val", False),
|
|
|
- )
|
|
|
-
|
|
|
- logging.info(" ".join([
|
|
|
- f"Created {self.model.__class__.__name__} model",
|
|
|
- f"with \"{opts.prepare_type}\" prepare function."
|
|
|
- ]))
|
|
|
-
|
|
|
logging.info(" ".join([
|
|
|
f"Image input size: {size}",
|
|
|
f"Image parts input size: {part_size}",
|