whoami02 commited on
Commit
5f14585
·
verified ·
1 Parent(s): b2c32bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -8,24 +8,22 @@ import pandas as pd
8
  from doctr.io import DocumentFile
9
  from doctr.models import ocr_predictor
10
  from PIL import Image, ImageDraw
11
- path = r"/ocr_vst/"
12
 
13
  if os.path.exists('tp'):
14
- img_temp = r"/ocr_vst/tp"
15
  else:
16
  os.mkdir(os.path.join(path, "tp"))
17
- img_temp = r"/ocr_vst/tp"
18
 
19
  if os.path.exists('tp1'):
20
- sub_img_temp = r"/ocr_vst/tp1"
21
  else:
22
  os.mkdir(os.path.join(path, "tp1"))
23
- sub_img_temp = r"/ocr_vst/tp1"
24
 
25
  def load_model():
26
  return ocr_predictor(
27
- # det_arch="db_resnet50_rotation",
28
- # reco_arch="crnn_mobilenet_v3_large",
29
  det_arch='linknet_resnet18_rotation',
30
  reco_arch='crnn_vgg16_bn',
31
  detect_orientation=True,
 
8
  from doctr.io import DocumentFile
9
  from doctr.models import ocr_predictor
10
  from PIL import Image, ImageDraw
11
+ path = r"./master/ocr_vst/"
12
 
13
  if os.path.exists('tp'):
14
+ img_temp = os.path.join(path, "tp")
15
  else:
16
  os.mkdir(os.path.join(path, "tp"))
17
+ img_temp = os.path.join(path, "tp")
18
 
19
  if os.path.exists('tp1'):
20
+ sub_img_temp = os.path.join(path, "tp1")
21
  else:
22
  os.mkdir(os.path.join(path, "tp1"))
23
+ sub_img_temp = os.path.join(path, "tp1")
24
 
25
  def load_model():
26
  return ocr_predictor(
 
 
27
  det_arch='linknet_resnet18_rotation',
28
  reco_arch='crnn_vgg16_bn',
29
  detect_orientation=True,