Test notebooks #28
This file contains 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: Test notebooks | |
on: | |
push: | |
branches: | |
- dev | |
schedule: | |
- cron: 0 0 1 * * | |
env: | |
DPTEXT_PATH: ${{ github.workspace }}/DPText-DETR | |
DEEPSOLO_PATH: ${{ github.workspace }}/DeepSolo | |
DPTEXT_MODEL_PATH: ${{ github.workspace }}/art_final.pth | |
DEEPSOLO_MODEL_PATH: ${{ github.workspace }}/ic15_res50_finetune_synth-tt-mlt-13-15-textocr.pth | |
jobs: | |
all_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Update pip | |
run: | | |
python -m ensurepip | |
python -m pip install --upgrade pip | |
- name: Install dependencies | |
run: | | |
python -m pip install wheel | |
python -m pip install 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 -r requirements.txt | |
pip install papermill | |
- 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: Hugging Face CLI | |
run: | | |
pip install -U "huggingface_hub[cli]" | |
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 . | |
- name: Run notebooks | |
run: | | |
find . -name "*.ipynb" -exec sed -Ei "s/num_epochs=.?.?/num_epochs=1/g" {} + | |
find . -name "*.ipynb" -exec sed -i "s/annotator.annotate/#annotator.annotate/g" {} + | |
find . -name "*.ipynb" -print0 | xargs -0 -I {} -t bash -c 'papermill --cwd $(dirname {}) --log-output {} {} || exit 255' |