Mountchicken commited on
Commit
bf6e441
1 Parent(s): aae1cba

[Update] Add dependices

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -6,7 +6,23 @@ import numpy as np
6
  # MMOCR
7
  from mmocr.apis.inferencers import MMOCRInferencer
8
 
9
- # BUILD MMOCR
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
 
12
  def arg_parse():
 
6
  # MMOCR
7
  from mmocr.apis.inferencers import MMOCRInferencer
8
 
9
+ # Install dependencies
10
+ os.system(
11
+ 'conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch' # noqa
12
+ )
13
+ os.system('python -m mim install mmocr')
14
+ os.system('python -m mim install "mmcv==2.0.0rc4"')
15
+ os.system('python -m mim install mmengine')
16
+ os.system('python -m mim install "mmdet>=3.0.0rc5"')
17
+
18
+ # Download checkpoints
19
+ os.system(
20
+ 'wget https://download.openmmlab.com/mmocr/textdet/dbnetpp/dbnetpp_resnet50-oclip_fpnc_1200e_icdar2015/dbnetpp_resnet50-oclip_fpnc_1200e_icdar2015_20221101_124139-4ecb39ac.pth -O mmocr-dev-1.x/dbnetpp.pth' # noqa
21
+ )
22
+ os.system(
23
+ 'wget https://github.com/Mountchicken/Union14M/releases/download/Checkpoint/maerec_b_union14m.pth -O mmocr-dev-1.x/maerec_b_union14m.pth'
24
+ )
25
+
26
 
27
 
28
  def arg_parse():