Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
# Hugging Face
|
5 |
-
model_name = "
|
6 |
image_to_text = pipeline("image-to-text", model=model_name)
|
7 |
|
8 |
# Gradioの関数定義
|
@@ -16,8 +16,8 @@ iface = gr.Interface(
|
|
16 |
fn=generate_text_from_image,
|
17 |
inputs=gr.Image(type="pil"),
|
18 |
outputs="text",
|
19 |
-
title="Image to Text with
|
20 |
-
description="Upload an image to get a descriptive text generated by
|
21 |
)
|
22 |
|
23 |
# Gradioアプリケーションの起動
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Hugging Faceの互換性のあるモデルをロード(image-to-textタスク用)
|
5 |
+
model_name = "Salesforce/blip-image-captioning-base"
|
6 |
image_to_text = pipeline("image-to-text", model=model_name)
|
7 |
|
8 |
# Gradioの関数定義
|
|
|
16 |
fn=generate_text_from_image,
|
17 |
inputs=gr.Image(type="pil"),
|
18 |
outputs="text",
|
19 |
+
title="Image to Text with BLIP Model",
|
20 |
+
description="Upload an image to get a descriptive text generated by the BLIP image captioning model."
|
21 |
)
|
22 |
|
23 |
# Gradioアプリケーションの起動
|