diff --git a/dan/ocr/predict/inference.py b/dan/ocr/predict/inference.py index e690b72d1b1d63b013b429fbff257f37f33c56e8..c869d4e1fb7e2d6a3583e360adef5e654079607a 100644 --- a/dan/ocr/predict/inference.py +++ b/dan/ocr/predict/inference.py @@ -125,6 +125,9 @@ class DAN: image = read_image(path) preprocessed_image = self.preprocessing_transforms(image) + if self.mean is None and self.std is None: + return preprocessed_image, preprocessed_image + size = preprocessed_image.shape normalized_image = torch.zeros(size)