Commit
•
fdfdf8e
1
Parent(s):
b3556a1
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from PIL import Image
|
3 |
import clipGPT
|
|
|
|
|
4 |
|
5 |
# Define model loading functions (if needed)
|
6 |
def load_model_1(): # CLIP-GPT2
|
@@ -11,7 +13,9 @@ def load_model_1(): # CLIP-GPT2
|
|
11 |
|
12 |
# Caption generation functions
|
13 |
def generate_caption_clipgpt(image):
|
14 |
-
|
|
|
|
|
15 |
return caption
|
16 |
|
17 |
# ... Add more caption generation functions for future models
|
|
|
1 |
import gradio as gr
|
2 |
from PIL import Image
|
3 |
import clipGPT
|
4 |
+
import skimage.io as io
|
5 |
+
import PIL.Image
|
6 |
|
7 |
# Define model loading functions (if needed)
|
8 |
def load_model_1(): # CLIP-GPT2
|
|
|
13 |
|
14 |
# Caption generation functions
|
15 |
def generate_caption_clipgpt(image):
|
16 |
+
image = io.imread(img)
|
17 |
+
pil_image = PIL.Image.fromarray(image)
|
18 |
+
caption = clipGPT.generate_caption_clipgpt(pil_image)
|
19 |
return caption
|
20 |
|
21 |
# ... Add more caption generation functions for future models
|