Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,12 @@ import difflib
|
|
10 |
import ViTCoAtt
|
11 |
from build_vocab import Vocabulary
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# Caption generation functions
|
16 |
def generate_caption_clipgpt(image):
|
|
|
10 |
import ViTCoAtt
|
11 |
from build_vocab import Vocabulary
|
12 |
|
13 |
+
def render_image(image_path_or_url):
|
14 |
+
img = Image.open(io.imread(image_path_or_url))
|
15 |
+
img = img.resize((80, 80)) # Adjust size as needed
|
16 |
+
buf = io.BytesIO()
|
17 |
+
img.save(buf, format='JPEG')
|
18 |
+
return buf.getvalue()
|
19 |
|
20 |
# Caption generation functions
|
21 |
def generate_caption_clipgpt(image):
|