Theivaprakasham commited on
Commit
def6f37
1 Parent(s): 14ee481

Add layout detection app.py

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. requirements.txt +2 -0
app.py CHANGED
@@ -7,9 +7,8 @@ import PIL
7
 
8
  os.system('pip install "git+https://github.com/facebookresearch/[email protected]#egg=detectron2" ')
9
 
10
- model = lp.Detectron2LayoutModel('lp://PubLayNet/faster_rcnn_R_50_FPN_3x/config',
11
- extra_config=["MODEL.ROI_HEADS.SCORE_THRESH_TEST", 0.8],
12
- label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})
13
 
14
  article="References<br>[1] Z. Shen, R. Zhang, M. Dell, B. C. G. Lee, J. Carlson, and W. Li, “LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis,” arXiv Prepr. arXiv2103.15348, 2021."
15
  description = "Layout Detection/Parsing is one of the important tasks of converting unstructured data into structured data. This task helps to automate, digitize and organize the data in a usable format. In this project, we utilize LayoutParser library (https://github.com/Layout-Parser/layout-parser) to perform Layout Detection using pre-trained Faster_rcnn_R_50_FPN model that can classify the layout based on Text, Title, List, Table and Figure. Upload an image of a document or click an example image to check this out."
 
7
 
8
  os.system('pip install "git+https://github.com/facebookresearch/[email protected]#egg=detectron2" ')
9
 
10
+ model = lp.AutoLayoutModel("lp://efficientdet/PubLayNet", label_map={0: "Text", 1: "Title", 2: "List", 3:"Table", 4:"Figure"})
11
+
 
12
 
13
  article="References<br>[1] Z. Shen, R. Zhang, M. Dell, B. C. G. Lee, J. Carlson, and W. Li, “LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis,” arXiv Prepr. arXiv2103.15348, 2021."
14
  description = "Layout Detection/Parsing is one of the important tasks of converting unstructured data into structured data. This task helps to automate, digitize and organize the data in a usable format. In this project, we utilize LayoutParser library (https://github.com/Layout-Parser/layout-parser) to perform Layout Detection using pre-trained Faster_rcnn_R_50_FPN model that can classify the layout based on Text, Title, List, Table and Figure. Upload an image of a document or click an example image to check this out."
requirements.txt CHANGED
@@ -1,4 +1,6 @@
 
1
  layoutparser==0.3.2
 
2
  torch
3
  torchvision
4
  torchaudio
 
1
+ effdet
2
  layoutparser==0.3.2
3
+ layoutparser[effdet]
4
  torch
5
  torchvision
6
  torchaudio