Spaces:
Sleeping
Sleeping
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
#
|
| 5 |
pipe = pipeline(
|
| 6 |
-
"image-to-text",
|
| 7 |
-
model="
|
| 8 |
)
|
| 9 |
|
| 10 |
def describe_image(image):
|
|
@@ -19,9 +19,10 @@ demo = gr.Interface(
|
|
| 19 |
fn=describe_image,
|
| 20 |
inputs=gr.Image(type="pil"),
|
| 21 |
outputs="text",
|
| 22 |
-
title="🖼️ Image
|
| 23 |
-
description="Upload an image and
|
| 24 |
)
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
-
demo.launch()
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Lightweight image captioning model
|
| 5 |
pipe = pipeline(
|
| 6 |
+
"image-text-to-text",
|
| 7 |
+
model="microsoft/git-base"
|
| 8 |
)
|
| 9 |
|
| 10 |
def describe_image(image):
|
|
|
|
| 19 |
fn=describe_image,
|
| 20 |
inputs=gr.Image(type="pil"),
|
| 21 |
outputs="text",
|
| 22 |
+
title="🖼️ Image Description AI (Lightweight)",
|
| 23 |
+
description="Upload an image and the AI will describe it."
|
| 24 |
)
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
+
demo.launch()
|
| 28 |
+
|