madhavkotecha commited on
Commit
4e7f32f
1 Parent(s): a066c85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -180,10 +180,10 @@ def process_image(image):
180
  bounding_img = Image.open(bounding_path)
181
  return bounding_img, before_text, text
182
 
183
- # Define Gradio Interface
184
  interface = gr.Interface(
185
- fn=process_image, # Call the process_image function
186
- inputs=gr.Image(type="pil"), # Expect an image input
187
  outputs=[
188
  gr.Image(type="pil", label="Bounding Box Image"),
189
  gr.Textbox(label="Extracted Text (Custom trained YOLO Object Detection + TrOCR Vision Transformer)"),
@@ -193,6 +193,5 @@ interface = gr.Interface(
193
  description="Upload an image to detect text regions with YOLO, merge bounding boxes, and extract text using TrOCR which is then preprocessed with Roberta for contextual understanding.",
194
  )
195
 
196
- # Launch the interface
197
  if __name__ == "__main__":
198
  interface.launch(share=True)
 
180
  bounding_img = Image.open(bounding_path)
181
  return bounding_img, before_text, text
182
 
183
+
184
  interface = gr.Interface(
185
+ fn=process_image,
186
+ inputs=gr.Image(type="pil"),
187
  outputs=[
188
  gr.Image(type="pil", label="Bounding Box Image"),
189
  gr.Textbox(label="Extracted Text (Custom trained YOLO Object Detection + TrOCR Vision Transformer)"),
 
193
  description="Upload an image to detect text regions with YOLO, merge bounding boxes, and extract text using TrOCR which is then preprocessed with Roberta for contextual understanding.",
194
  )
195
 
 
196
  if __name__ == "__main__":
197
  interface.launch(share=True)