nielsr HF staff fendiprime commited on
Commit
608106d
1 Parent(s): b850884

Update Detectron2 dependency, make collections API usage compatible with Python 3.10 (#5)

Browse files

- Update Detectron2 dependency, make collections API usage compatible with Python 3.10 (7886ba979902091108ee1f09e85e5ae9ec3770de)


Co-authored-by: Fred <[email protected]>

Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import os
2
- os.system('pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html')
 
3
  os.system("git clone https://github.com/microsoft/unilm.git")
 
4
  os.system("curl -LJ -o publaynet_dit-b_cascade.pth 'https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_cascade.pth?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D'")
5
 
6
  import sys
7
  sys.path.append("unilm")
 
8
 
9
  import cv2
10
 
 
1
  import os
2
+ os.system('git clone https://github.com/facebookresearch/detectron2.git')
3
+ os.system('pip install -e detectron2')
4
  os.system("git clone https://github.com/microsoft/unilm.git")
5
+ os.system("sed -i 's/from collections import Iterable/from collections.abc import Iterable/' unilm/dit/object_detection/ditod/table_evaluation/data_structure.py")
6
  os.system("curl -LJ -o publaynet_dit-b_cascade.pth 'https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_cascade.pth?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D'")
7
 
8
  import sys
9
  sys.path.append("unilm")
10
+ sys.path.append("detectron2")
11
 
12
  import cv2
13