artificialguybr commited on
Commit
02256ee
·
verified ·
1 Parent(s): 91099cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -38,11 +38,13 @@ def ocr_function(img, lang_name):
38
 
39
  def text_line_detection_function(img):
40
  print("Text Line Detection Function Called")
41
- preds = batch_detection([img], det_model, det_processor)[0]
42
  print(f"Detection Predictions: {preds}")
43
- img_with_lines = draw_polys_on_image(preds["polygons"], img)
 
44
  return img_with_lines, preds
45
 
 
46
  with gr.Blocks() as app:
47
  gr.Markdown("# Surya OCR and Text Line Detection")
48
  with gr.Tab("OCR"):
 
38
 
39
  def text_line_detection_function(img):
40
  print("Text Line Detection Function Called")
41
+ preds = batch_detection([img], det_model, det_processor)[0] # Assuming this returns a DetectionResult object
42
  print(f"Detection Predictions: {preds}")
43
+ # Adjusted access to properties of preds
44
+ img_with_lines = draw_polys_on_image(preds.polygons, img) # Assuming preds has a .polygons attribute
45
  return img_with_lines, preds
46
 
47
+
48
  with gr.Blocks() as app:
49
  gr.Markdown("# Surya OCR and Text Line Detection")
50
  with gr.Tab("OCR"):