Spaces:
Runtime error
Runtime error
jaekookang
commited on
Commit
Β·
dbb7b85
1
Parent(s):
21c7de8
remove remove_alpha_channel
Browse files
.ipynb_checkpoints/gradio_artist_classifier-checkpoint.py
CHANGED
@@ -43,7 +43,7 @@ def load_json_as_dict(json_file):
|
|
43 |
|
44 |
def load_image_as_array(image_file):
|
45 |
img = skimage.io.imread(image_file, as_gray=False, plugin='matplotlib')
|
46 |
-
if (img.shape[-1] > 3)
|
47 |
img = img[..., :-1]
|
48 |
return img
|
49 |
|
|
|
43 |
|
44 |
def load_image_as_array(image_file):
|
45 |
img = skimage.io.imread(image_file, as_gray=False, plugin='matplotlib')
|
46 |
+
if (img.shape[-1] > 3): # if RGBA
|
47 |
img = img[..., :-1]
|
48 |
return img
|
49 |
|
gradio_artist_classifier.py
CHANGED
@@ -43,7 +43,7 @@ def load_json_as_dict(json_file):
|
|
43 |
|
44 |
def load_image_as_array(image_file):
|
45 |
img = skimage.io.imread(image_file, as_gray=False, plugin='matplotlib')
|
46 |
-
if (img.shape[-1] > 3)
|
47 |
img = img[..., :-1]
|
48 |
return img
|
49 |
|
|
|
43 |
|
44 |
def load_image_as_array(image_file):
|
45 |
img = skimage.io.imread(image_file, as_gray=False, plugin='matplotlib')
|
46 |
+
if (img.shape[-1] > 3): # if RGBA
|
47 |
img = img[..., :-1]
|
48 |
return img
|
49 |
|