From 75674710b5e795c009ab570708602e26091c9d55 Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Thu, 18 May 2017 11:52:53 +0800 Subject: [PATCH] Remove opencv-python in setup --- python/paddle/v2/image.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/paddle/v2/image.py b/python/paddle/v2/image.py index 13f53919aa4..85ad6984ba0 100644 --- a/python/paddle/v2/image.py +++ b/python/paddle/v2/image.py @@ -1,10 +1,10 @@ import numpy as np try: import cv2 -except ImportError: - cv2 = None - -from cv2 import resize +except: + print( + "import cv2 error, please install opencv-python: pip install opencv-python" + ) __all__ = [ "load_image", "resize_short", "to_chw", "center_crop", "random_crop", @@ -76,7 +76,7 @@ def resize_short(im, size): h_new = size * h / w else: w_new = size * w / h - im = resize(im, (h_new, w_new), interpolation=cv2.INTER_CUBIC) + im = cv2.resize(im, (h_new, w_new), interpolation=cv2.INTER_CUBIC) return im -- GitLab