Skip to content

Commit 69fc707

Browse files
committed
Update readme with example image
1 parent 3bf0ce1 commit 69fc707

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/example.png

2.42 MB
Loading

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ We provide a series of examples for to help you start using the layout parser li
3939
2. [Deep Layout Parsing Example](https://github.com/Layout-Parser/layout-parser/blob/master/examples/Deep%20Layout%20Parsing.ipynb): With the help of Deep Learning, `layoutparser` supports the analysis very complex documents and processing of the hierarchical structure in the layouts.
4040

4141

42-
## DL Assisted Layout Prediction
42+
## DL Assisted Layout Prediction Example
43+
44+
![Example Usage](.github/example.png)
45+
46+
*The images shown in the figure above are: a screenshot of [this paper](https://arxiv.org/abs/2004.08686), an image from the [PRIMA Layout Analysis Dataset](https://www.primaresearch.org/dataset/), a screenshot of the [WSJ website](http://wsj.com), and an image from the [HJDataset](https://dell-research-harvard.github.io/HJDataset/).*
4347

4448
With only 4 lines of code in `layoutparse`, you can unlock the information from complex documents that existing tools could not provide. You can either choose a deep learning model from the [ModelZoo](https://github.com/Layout-Parser/layout-parser/blob/master/docs/notes/modelzoo.md), or load the model that you trained on your own. And use the following code to predict the layout as well as visualize it:
4549

4650
```python
4751
>>> import layoutparser as lp
48-
>>> model = lp.Detectron2LayoutModel('lp://HJDataset/faster_rcnn_R_50_FPN_3x/config')
52+
>>> model = lp.Detectron2LayoutModel('lp://PrimaLayout/mask_rcnn_R_50_FPN_3x/config')
4953
>>> layout = model.detect(image) # You need to load the image somewhere else, e.g., image = cv2.imread(...)
50-
>>> lp.draw_box(image, layout, box_width=3)
51-
```
54+
>>> lp.draw_box(image, layout,) # With extra configurations
55+
```

0 commit comments

Comments
 (0)