Amandeep01 commited on
Commit
fa7dd7b
·
verified ·
1 Parent(s): 95e1f25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -44,20 +44,21 @@ def process_image(image, target_lang):
44
  cloud_url = generate_cloudinary_url(full_text.strip())
45
  return cloud_url, full_text.strip()
46
 
47
- # Gradio UI setup
48
  iface = gr.Interface(
49
  fn=process_image,
50
  inputs=[
51
- gr.Image(type="pil", label="Upload Image"), # Upload image input
52
- gr.Textbox(label="Target Language (e.g., hin_Deva, mar_Deva, nep_Deva)") # Textbox for target language
53
  ],
54
  outputs=[
55
- gr.Image(type="url", label="Image with Cloudinary Text"), # Image with overlay from Cloudinary
56
- gr.Textbox(label="Translated Text Output") # Output of translated text
57
  ],
58
  title="Advanced Image Translator",
59
  description="Extract & translate text from an image (OCR + translation overlay)"
60
  )
61
 
 
62
  if __name__ == "__main__":
63
  iface.launch() # Launch Gradio interface
 
44
  cloud_url = generate_cloudinary_url(full_text.strip())
45
  return cloud_url, full_text.strip()
46
 
47
+ # Inside Gradio interface
48
  iface = gr.Interface(
49
  fn=process_image,
50
  inputs=[
51
+ gr.Image(type="pil", label="Upload Image"),
52
+ gr.Textbox(label="Target Language (e.g., hin_Deva, mar_Deva, nep_Deva)")
53
  ],
54
  outputs=[
55
+ gr.HTML(label="Image with Cloudinary Text"), # changed from gr.Image to gr.HTML
56
+ gr.Textbox(label="Translated Text Output")
57
  ],
58
  title="Advanced Image Translator",
59
  description="Extract & translate text from an image (OCR + translation overlay)"
60
  )
61
 
62
+
63
  if __name__ == "__main__":
64
  iface.launch() # Launch Gradio interface