Omnibus commited on
Commit
db6d5bb
β€’
1 Parent(s): 6c0461e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,14 +6,14 @@ from PIL import Image
6
  from PIL import ImageDraw
7
 
8
 
9
- def draw_boxes(image, bounds, color='yellow', width=2):
10
  draw = ImageDraw.Draw(image)
11
  for bound in bounds:
12
  p0, p1, p2, p3 = bound[0]
13
  draw.line([*p0, *p1, *p2, *p3, *p0], fill=color, width=width)
14
  return image
15
 
16
- def detect(img, lang='en'):
17
  reader = easyocr.Reader(lang)
18
  bounds = reader.readtext(img.name)
19
  im = PIL.Image.open(img.name)
 
6
  from PIL import ImageDraw
7
 
8
 
9
+ def draw_boxes(image, bounds, color='blue', width=2):
10
  draw = ImageDraw.Draw(image)
11
  for bound in bounds:
12
  p0, p1, p2, p3 = bound[0]
13
  draw.line([*p0, *p1, *p2, *p3, *p0], fill=color, width=width)
14
  return image
15
 
16
+ def detect(img, lang=['en']):
17
  reader = easyocr.Reader(lang)
18
  bounds = reader.readtext(img.name)
19
  im = PIL.Image.open(img.name)