From f1e99813bfb8d29ca29c1381dd249cc440d92fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alperen=20Kantarc=C4=B1?= Date: Wed, 20 May 2020 00:55:48 +0300 Subject: [PATCH] NameError fix Import is uncommented to fix the NameError: name 'Image' is not defined error. --- opencv_transforms/functional.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv_transforms/functional.py b/opencv_transforms/functional.py index 7ad6dd2..f490307 100644 --- a/opencv_transforms/functional.py +++ b/opencv_transforms/functional.py @@ -1,7 +1,7 @@ import torch import math import random -# from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION +from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION try: import accimage except ImportError: @@ -555,4 +555,4 @@ def to_grayscale(img, num_output_channels=1): elif num_output_channels==3: # much faster than doing cvtColor to go back to gray img = np.broadcast_to(cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)[:,:,np.newaxis], img.shape) - return img \ No newline at end of file + return img