MrSalman commited on
Commit
8960167
1 Parent(s): 235ef43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -34,14 +34,14 @@ def translate_text(text, to="ar"):
34
  def image_captioning_ar(image, prefix = "a "):
35
  if image:
36
  text = image_captioning(image, prefix=prefix)
37
- return translate_text(text)
38
  return null
39
 
40
  input_image = gr.inputs.Image(type="pil", label = 'Upload your image')
41
  imageCaptioning_interface = gr.Interface(
42
  fn = image_captioning_ar,
43
  inputs=input_image,
44
- outputs=gr.outputs.Textbox(label="Caption"),
45
  title = 'Image captioning',
46
  )
47
  imageCaptioning_interface.launch()
 
34
  def image_captioning_ar(image, prefix = "a "):
35
  if image:
36
  text = image_captioning(image, prefix=prefix)
37
+ return text, translate_text(text)
38
  return null
39
 
40
  input_image = gr.inputs.Image(type="pil", label = 'Upload your image')
41
  imageCaptioning_interface = gr.Interface(
42
  fn = image_captioning_ar,
43
  inputs=input_image,
44
+ outputs=[gr.outputs.Textbox(label="Caption (en)"), gr.outputs.Textbox(label="Caption (ar)")],
45
  title = 'Image captioning',
46
  )
47
  imageCaptioning_interface.launch()