Add Pytorch lightning classifier #237
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Units Tests - Text Spotting | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| # Cancel existing tests on the same PR if a new commit is added to a pull request | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| # Run linter with github actions for quick feedbacks. | |
| jobs: | |
| all_tests: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| fail-fast: false | |
| env: | |
| # point datasets to ~/.torch so it's cached by CI | |
| DETECTRON2_DATASETS: ~/.torch/datasets | |
| PYTHONIOENCODING: utf-8 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 2 | |
| - name: Free disk space (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo apt-get clean | |
| df -h | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.11 | |
| - name: Install ninja-build tool | |
| uses: seanmiddleditch/gha-setup-ninja@v5 | |
| with: | |
| version: 1.12.1 | |
| - name: Update pip | |
| run: | | |
| python -m ensurepip | |
| python -m pip install --upgrade pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --no-cache-dir wheel | |
| python -m pip install --no-cache-dir numpy==1.26.4 torch==2.2.2 torchvision==0.17.2 -f https://download.pytorch.org/whl/torch_stable.html | |
| python -m pip install --no-cache-dir ".[dev, lightning]" | |
| python -m pip install --no-cache-dir pytest-cov | |
| python -m pip install --no-cache-dir --no-build-isolation 'git+https://github.com/facebookresearch/detectron2.git' | |
| python -m pip install --no-cache-dir --no-build-isolation 'git+https://github.com/maps-as-data/DeepSolo.git' | |
| python -m pip install --no-cache-dir --no-build-isolation 'git+https://github.com/maps-as-data/DPText-DETR.git' | |
| python -m pip install --no-cache-dir --no-build-isolation 'git+https://github.com/maps-as-data/MapTextPipeline.git' | |
| - name: Clone DPText-DETR | |
| run: | | |
| git clone https://github.com/maps-as-data/DPText-DETR.git | |
| - name: Clone DeepSolo | |
| run: | | |
| git clone https://github.com/maps-as-data/DeepSolo.git | |
| - name: Clone MapTextPipeline | |
| run: | | |
| git clone https://github.com/maps-as-data/MapTextPipeline.git | |
| - name: Hugging Face CLI | |
| run: | | |
| pip install -U "huggingface-hub[cli]>=0.30.0,<0.34.0" | |
| huggingface-cli download rwood-97/DPText_DETR_ArT_R_50_poly art_final.pth --local-dir . | |
| huggingface-cli download rwood-97/DeepSolo_ic15_res50 ic15_res50_finetune_synth-tt-mlt-13-15-textocr.pth --local-dir . | |
| huggingface-cli download rwood-97/MapTextPipeline_rumsey rumsey-finetune.pth --local-dir . | |
| - name: Test with pytest | |
| run: | | |
| python -m pytest ./tests |