Awiny commited on
Commit
80f89b9
β€’
1 Parent(s): 44a0c32

full cpu support

Browse files
app.py CHANGED
@@ -97,6 +97,12 @@ logo_base64 = add_logo()
97
  # Create the title with the logo
98
  title_with_logo = f'<img src="data:image/jpeg;base64,{logo_base64}" width="400" style="vertical-align: middle;"> Understanding Image with Text'
99
 
 
 
 
 
 
 
100
  # Create Gradio interface
101
  interface = gr.Interface(
102
  fn=lambda image, options: process_image(image, options, processor),
@@ -108,6 +114,7 @@ interface = gr.Interface(
108
  ],
109
  outputs=gr.outputs.HTML(),
110
  title=title_with_logo,
 
111
  description="""
112
  This code support image to text transformation. Then the generated text can do retrieval, question answering et al to conduct zero-shot.
113
  \n Since GPU is expensive, we use CPU for demo. Run code local with gpu or google colab we provided for fast speed.
 
97
  # Create the title with the logo
98
  title_with_logo = f'<img src="data:image/jpeg;base64,{logo_base64}" width="400" style="vertical-align: middle;"> Understanding Image with Text'
99
 
100
+ examples = [
101
+ ["examples/test_3.jpg"],
102
+ ["examples/test_4.jpg"],
103
+ ["examples/test_5.jpg"],
104
+ ]
105
+
106
  # Create Gradio interface
107
  interface = gr.Interface(
108
  fn=lambda image, options: process_image(image, options, processor),
 
114
  ],
115
  outputs=gr.outputs.HTML(),
116
  title=title_with_logo,
117
+ examples=examples,
118
  description="""
119
  This code support image to text transformation. Then the generated text can do retrieval, question answering et al to conduct zero-shot.
120
  \n Since GPU is expensive, we use CPU for demo. Run code local with gpu or google colab we provided for fast speed.
examples/{3.jpg β†’ test_3.jpg} RENAMED
File without changes
examples/test_4.jpg ADDED
examples/test_5.jpg ADDED