vam
commited on
Commit
•
868c708
1
Parent(s):
c0a0cd2
bug fixed for 2 color image
Browse files
app.py
CHANGED
@@ -55,6 +55,10 @@ def create_meme(prompt):
|
|
55 |
|
56 |
img_path = meme_filename[closest_text_idx]
|
57 |
img = mpimg.imread(f'kaggle/input/memedata/{img_path}')
|
|
|
|
|
|
|
|
|
58 |
|
59 |
white_space_height = 100
|
60 |
white_space = np.ones((white_space_height, img.shape[1], img.shape[2]), dtype=img.dtype) * 255
|
|
|
55 |
|
56 |
img_path = meme_filename[closest_text_idx]
|
57 |
img = mpimg.imread(f'kaggle/input/memedata/{img_path}')
|
58 |
+
if len(img.shape) == 2:
|
59 |
+
img = np.stack((img,)*3, axis=-1)
|
60 |
+
|
61 |
+
img_height, img_width = img.shape[:2]
|
62 |
|
63 |
white_space_height = 100
|
64 |
white_space = np.ones((white_space_height, img.shape[1], img.shape[2]), dtype=img.dtype) * 255
|