diff --git a/.github/layout-parser.png b/.github/layout-parser.png index fd6db6f..c2470ab 100644 Binary files a/.github/layout-parser.png and b/.github/layout-parser.png differ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eac6308..d7fbe98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,70 @@ name: CI -on: [push] +on: [push, pull_request] jobs: - build: + + test_only_effdet_backend: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Test Dependency Support + run: | + pip install pytest + pip install -e . # The bare layoutparser module + pytest tests_deps/test_file_utils.py + + - name: Install only effdet deps + run: | + pip install pytest + pip install -e ".[effdet]" + pytest tests_deps/test_only_effdet.py + + test_only_detectron2_backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install only Detectron2 deps + run: | + pip install pytest + pip install -e . + pip install torchvision && pip install "git+https://github.com/facebookresearch/detectron2.git@v0.5#egg=detectron2" + pytest tests_deps/test_only_detectron2.py + + test_only_paddledetection_backend: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install only PaddleDetection deps + run: | + pip install pytest + pip install -e ".[paddledetection]" + pytest tests_deps/test_only_paddledetection.py + + test_all_methods_all_backends: + needs: [test_only_effdet_backend, test_only_detectron2_backend, test_only_paddledetection_backend] runs-on: ubuntu-latest strategy: matrix: python-version: [3.7, 3.8] - steps: - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: @@ -21,7 +74,6 @@ jobs: run: | python -m pip install --upgrade pip pip install . - pip install 'git+https://github.com/facebookresearch/detectron2.git@v0.1.3#egg=detectron2' - name: Lint with flake8 run: | @@ -30,9 +82,10 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --ignore F821 # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - + - name: Test with pytest run: | # Install additional requirements when running tests + pip install ".[effdet]" pip install -r dev-requirements.txt - pytest + pytest tests diff --git a/.gitignore b/.gitignore index 9ca0988..07d8d90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Examples files +examples/Customizing Layout Models with Label Studio Annotation/downloaded-annotations + *.bak .gitattributes .last_checked diff --git a/.readthedocs.yml b/.readthedocs.yml index 278ec86..8a2495e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -18,4 +18,6 @@ python: install: - method: pip path: . + extra_requirements: + - effdet - requirements: dev-requirements.txt \ No newline at end of file diff --git a/README.md b/README.md index a6958df..15ec7ba 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,113 @@
-
+
| \n", + " | page_index | \n", + "bib-item | \n", + "
|---|---|---|
| 0 | \n", + "8 | \n", + "Anant K. Agarwal, Ivan Zaitsev, Xuanhui Wang, ... | \n", + "
| 1 | \n", + "8 | \n", + "Waleed Ammar, Dirk Groeneveld, Chandra Bha- ga... | \n", + "
| 2 | \n", + "9 | \n", + "Liqun Chen, Guoyin Wang, Chenyang Tao, Ding- h... | \n", + "
| 3 | \n", + "9 | \n", + "Christophe Van Gysel, Maarten de Rijke, and Ev... | \n", + "
| 4 | \n", + "9 | \n", + "Joan Bruna, Wojciech Zaremba, Arthur Szlam, an... | \n", + "
| 5 | \n", + "9 | \n", + "Will Hamilton, Zhitao Ying, and Jure Leskovec.... | \n", + "
| 6 | \n", + "9 | \n", + "William L. Hamilton, Zhitao Ying, and Jure Les... | \n", + "
| 7 | \n", + "9 | \n", + "Jeremy Howard and Sebastian Ruder. 2018. Unive... | \n", + "
| 8 | \n", + "9 | \n", + "Tsung Teng Chen and Maria Lee. 2018. Research ... | \n", + "
| 9 | \n", + "9 | \n", + "Chanwoo Jeong, Sion Jang, Hyuna Shin, Eun- jeo... | \n", + "
| 10 | \n", + "9 | \n", + "Richard Klavans and Kevin W. Boyack. 2006. Ide... | \n", + "
| 11 | \n", + "9 | \n", + "Iz Beltagy, Kyle Lo, and Arman Cohan. 2019. Sc... | \n", + "
| 12 | \n", + "9 | \n", + "Anshul Kanakia, Zhihong Shen, Darrin Eide, and... | \n", + "
| 13 | \n", + "9 | \n", + "Sergey Feldman, Waleed Ammar, Kyle Lo, Elly Tr... | \n", + "
| 14 | \n", + "9 | \n", + "Jey Han Lau and Timothy Baldwin. 2016. An empi... | \n", + "
| 15 | \n", + "9 | \n", + "Martin Ester, Hans-Peter Kriegel, J¨org Sander... | \n", + "
| 16 | \n", + "9 | \n", + "Jimmy J. Lin. 2008. Is searching full text mor... | \n", + "
| 17 | \n", + "9 | \n", + "J Ganesh, Manish Gupta, and Vijay K. Varma. 20... | \n", + "
| 18 | \n", + "9 | \n", + "Erik Holmer and Andreas Marfurt. 2018. Explain... | \n", + "
| 19 | \n", + "9 | \n", + "Thomas N Kipf and Max Welling. 2017. Semi- sup... | \n", + "
| 20 | \n", + "9 | \n", + "Matt Gardner, Joel Grus, Mark Neumann, Oyvind ... | \n", + "
| 21 | \n", + "9 | \n", + "K. Bretonnel Cohen, Helen L. Johnson, Karin M.... | \n", + "
| 22 | \n", + "9 | \n", + "Diederik P. Kingma and Jimmy Ba. 2014. A Metho... | \n", + "
| 23 | \n", + "9 | \n", + "Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, R... | \n", + "
| 24 | \n", + "9 | \n", + "Quoc Le and Tomas Mikolov. 2014. Distributed R... | \n", + "
| 25 | \n", + "9 | \n", + "Alexis Conneau, Douwe Kiela, Holger Schwenk, L... | \n", + "
| 26 | \n", + "9 | \n", + "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and ... | \n", + "
| 27 | \n", + "9 | \n", + "Carolyn E Lipscomb. 2000. Medical Subject Head... | \n", + "
| 28 | \n", + "9 | \n", + "Chandra Bhagavatula, Sergey Feldman, Russell P... | \n", + "
| 29 | \n", + "9 | \n", + "Piotr Bojanowski, Edouard Grave, Armand Joulin... | \n", + "
| 30 | \n", + "9 | \n", + "A simple but tough-to-beat baseline for senten... | \n", + "
| 31 | \n", + "10 | \n", + "F. Pedregosa, G. Varoquaux, A. Gramfort, V. Mi... | \n", + "
| 32 | \n", + "10 | \n", + "Chundi Liu, Shunan Zhao, and Maksims Volkovs. ... | \n", + "
| 33 | \n", + "10 | \n", + "Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc ... | \n", + "
| 34 | \n", + "10 | \n", + "Martijn J. Schuemie, Marc Weeber, Bob J. A. Sc... | \n", + "
| 35 | \n", + "10 | \n", + "Hamed Zamani, Mostafa Dehghani, W. Bruce Croft... | \n", + "
| 36 | \n", + "10 | \n", + "Arnab Sinha, Zhihong Shen, Yang Song, Hao Ma, ... | \n", + "
| 37 | \n", + "10 | \n", + "Wenlin Wang, Chenyang Tao, Zhe Gan, Guoyin Wan... | \n", + "
| 38 | \n", + "10 | \n", + "Zhilin Yang, Zihang Dai, Yiming Yang, Jaime G.... | \n", + "
| 39 | \n", + "10 | \n", + "Laurens van der Maaten. 2014. Accelerating t-S... | \n", + "
| 40 | \n", + "10 | \n", + "Cunchao Tu, Han Liu, Zhiyuan Liu, and Maosong ... | \n", + "
| 41 | \n", + "10 | \n", + "J Ben Schafer, Dan Frankowski, Jon Herlocker, ... | \n", + "
| 42 | \n", + "10 | \n", + "Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong ... | \n", + "
| 43 | \n", + "10 | \n", + "Xinyuan Zhang, Yitong Li, Dinghan Shen, and La... | \n", + "
| 44 | \n", + "10 | \n", + "Alec Radford, Karthik Narasimhan, Tim Salimans... | \n", + "
| 45 | \n", + "10 | \n", + "Felix Wu, Amauri H. Souza, Tianyi Zhang, Chris... | \n", + "
| 46 | \n", + "10 | \n", + "Matthew E. Peters, Mark Neumann, Mohit Iyyer, ... | \n", + "
| 47 | \n", + "10 | \n", + "Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du,... | \n", + "
| 48 | \n", + "10 | \n", + "Lingfei Wu, Ian En-Hsu Yen, Kun Xu, Fangli Xu,... | \n", + "
| 49 | \n", + "10 | \n", + "Adina Williams, Nikita Nangia, and Samuel Bowm... | \n", + "
| 50 | \n", + "10 | \n", + "Radim ˇReh˚uˇrek and Petr Sojka. 2010. Softwar... | \n", + "
| 51 | \n", + "10 | \n", + "Allen Nie, Erin Bennett, and Noah Goodman. 201... | \n", + "
| 52 | \n", + "10 | \n", + "Dinghan Shen, Xinyuan Zhang, Ricardo Henao, an... | \n", + "
| 53 | \n", + "10 | \n", + "Pengfei Liu, King Keung Wu, and Helen M. Meng.... | \n", + "
| 54 | \n", + "10 | \n", + "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jak... | \n", + "
| 55 | \n", + "10 | \n", + "Nils Reimers and Iryna Gurevych. 2019. Sentenc... | \n", + "
| 56 | \n", + "10 | \n", + "Andrew Rosenberg and Julia Hirschberg. 2007. V... | \n", + "
| \n", + " | page_index | \n", + "bib-item | \n", + "
|---|---|---|
| 0 | \n", + "8 | \n", + "Anant K. Agarwal, Ivan Zaitsev, Xuanhui Wang, ... | \n", + "
| 1 | \n", + "8 | \n", + "Waleed Ammar, Dirk Groeneveld, Chandra Bha- ga... | \n", + "
| 2 | \n", + "9 | \n", + "A simple but tough-to-beat baseline for senten... | \n", + "
| 3 | \n", + "9 | \n", + "Iz Beltagy, Kyle Lo, and Arman Cohan. 2019. Sc... | \n", + "
| 4 | \n", + "9 | \n", + "Chandra Bhagavatula, Sergey Feldman, Russell P... | \n", + "
| 5 | \n", + "9 | \n", + "Piotr Bojanowski, Edouard Grave, Armand Joulin... | \n", + "
| 6 | \n", + "9 | \n", + "Joan Bruna, Wojciech Zaremba, Arthur Szlam, an... | \n", + "
| 7 | \n", + "9 | \n", + "Liqun Chen, Guoyin Wang, Chenyang Tao, Ding- h... | \n", + "
| 8 | \n", + "9 | \n", + "Tsung Teng Chen and Maria Lee. 2018. Research ... | \n", + "
| 9 | \n", + "9 | \n", + "K. Bretonnel Cohen, Helen L. Johnson, Karin M.... | \n", + "