suryabbrj commited on
Commit
2f32f94
·
1 Parent(s): 11933be

refined the output by removing unwanted string characters from the generated dict. using a simple python slice method! :/

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -30,7 +30,8 @@ cap = pipeline('image-to-text')
30
  def predict(image):
31
  cap = pipeline('image-to-text')
32
  caption = cap(image)
33
- return caption
 
34
 
35
 
36
  input = gr.inputs.Image(label="Upload your Image and wait for 8-12 seconds!", type = 'pil', optional=False)
 
30
  def predict(image):
31
  cap = pipeline('image-to-text')
32
  caption = cap(image)
33
+ output = str(caption)
34
+ return output[21:-4]
35
 
36
 
37
  input = gr.inputs.Image(label="Upload your Image and wait for 8-12 seconds!", type = 'pil', optional=False)