soiz commited on
Commit
bf13207
·
verified ·
1 Parent(s): 52c4825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Hugging Faceのモデルをロード(image-to-textタスク用)
5
- model_name = "zhendongw/prompt-diffusion"
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 Prompt Diffusion",
20
- description="Upload an image to get a descriptive text generated by zhendongw/prompt-diffusion model."
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アプリケーションの起動