From cd94246f50ccc5b4c2f6f9241a91dab2dcf9ebb5 Mon Sep 17 00:00:00 2001 From: chenjian Date: Tue, 23 Nov 2021 11:29:50 +0800 Subject: [PATCH] modify according to review --- .../enlightengan/enlighten_inference/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/image/image_processing/enlightengan/enlighten_inference/__init__.py b/modules/image/image_processing/enlightengan/enlighten_inference/__init__.py index b9ebee0f..5736aafc 100755 --- a/modules/image/image_processing/enlightengan/enlighten_inference/__init__.py +++ b/modules/image/image_processing/enlightengan/enlighten_inference/__init__.py @@ -14,7 +14,7 @@ class EnlightenOnnxModel: self.graph = InferenceSession(model or get_relative_path(__file__, 'enlighten.onnx')) def __repr__(self): - return f'' + return ' {}'.format(id(self)) def _pad(self, img): h, w, _ = img.shape @@ -26,7 +26,7 @@ class EnlightenOnnxModel: def _preprocess(self, img): if len(img.shape) != 3: - raise ValueError(f'Incorrect shape: expected 3, got {len(img.shape)}') + raise ValueError('Incorrect shape: expected 3, got {}'.format(img.shape)) return np.expand_dims(np.transpose(img, (2, 0, 1)).astype(np.float32) / 255., 0) def predict(self, img): -- GitLab