JustinLin610 commited on
Commit
332c912
1 Parent(s): f91298a
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -165,12 +165,12 @@ def apply_half(t):
165
  return t
166
 
167
 
168
- def ocr(img, task):
169
  out_img = Image.open(img)
170
- if task == "General":
171
  results = get_images(img, reader, text_confidence=0.7, text_threshold=0.43,
172
  link_threshold=0.43, slope_ths=0., add_margin=0.02)
173
- elif task == "Document":
174
  results = get_images(img, reader, text_threshold=0.3, sharp=1.2,
175
  contrast=1.2, space_ths=1.8)
176
  else:
 
165
  return t
166
 
167
 
168
+ def ocr(img, task_type):
169
  out_img = Image.open(img)
170
+ if task_type == "General":
171
  results = get_images(img, reader, text_confidence=0.7, text_threshold=0.43,
172
  link_threshold=0.43, slope_ths=0., add_margin=0.02)
173
+ elif task_type == "Document":
174
  results = get_images(img, reader, text_threshold=0.3, sharp=1.2,
175
  contrast=1.2, space_ths=1.8)
176
  else: