Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import torch
|
2 |
import re
|
3 |
-
import os
|
4 |
import gradio as gr
|
5 |
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
|
6 |
|
@@ -25,12 +29,12 @@ def predict(image,max_length=64, num_beams=4):
|
|
25 |
|
26 |
input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
|
27 |
output = gr.outputs.Textbox(type="auto",label="Captions")
|
28 |
-
|
29 |
-
|
30 |
description= "Image captioning application made using transformers"
|
31 |
title = "Image Captioning 🖼️"
|
32 |
|
33 |
-
article = "Created By :
|
34 |
|
35 |
interface = gr.Interface(
|
36 |
fn=predict,
|
|
|
1 |
+
|
2 |
+
import os
|
3 |
+
|
4 |
+
examples = os.listdir()
|
5 |
+
|
6 |
import torch
|
7 |
import re
|
|
|
8 |
import gradio as gr
|
9 |
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
|
10 |
|
|
|
29 |
|
30 |
input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
|
31 |
output = gr.outputs.Textbox(type="auto",label="Captions")
|
32 |
+
examples = [f"example{i}.jpg" for i in range(1,7)]
|
33 |
+
|
34 |
description= "Image captioning application made using transformers"
|
35 |
title = "Image Captioning 🖼️"
|
36 |
|
37 |
+
article = "Created By : Shreyas Dixit "
|
38 |
|
39 |
interface = gr.Interface(
|
40 |
fn=predict,
|