diff options
author | aktersnurra <gustaf.rydholm@gmail.com> | 2020-11-08 12:41:04 +0100 |
---|---|---|
committer | aktersnurra <gustaf.rydholm@gmail.com> | 2020-11-08 12:41:04 +0100 |
commit | beeaef529e7c893a3475fe27edc880e283373725 (patch) | |
tree | 59eb72562bf7a5a9470c2586e6280600ad94f1ae /src/text_recognizer/models/base.py | |
parent | 4d7713746eb936832e84852e90292936b933e87d (diff) |
Trying to get the CNNTransformer to work, but it is hard.
Diffstat (limited to 'src/text_recognizer/models/base.py')
-rw-r--r-- | src/text_recognizer/models/base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/text_recognizer/models/base.py b/src/text_recognizer/models/base.py index cbef787..cc44c92 100644 --- a/src/text_recognizer/models/base.py +++ b/src/text_recognizer/models/base.py @@ -141,11 +141,12 @@ class Model(ABC): "transform" in self.dataset_args["args"] and self.dataset_args["args"]["transform"] is not None ): - transform_ = [ - getattr(transforms_module, t["type"])() - for t in self.dataset_args["args"]["transform"] - ] + transform_ = [] + for t in self.dataset_args["args"]["transform"]: + args = t["args"] or {} + transform_.append(getattr(transforms_module, t["type"])(**args)) self.dataset_args["args"]["transform"] = Compose(transform_) + if ( "target_transform" in self.dataset_args["args"] and self.dataset_args["args"]["target_transform"] is not None |