From 7dcd8e92c23a31e36357fe17831d9e474b571c4f Mon Sep 17 00:00:00 2001 From: Olivier Dulcy Date: Wed, 27 Sep 2023 15:10:51 +0200 Subject: [PATCH] REVERT ME --- .github/workflows/builds.yml | 51 ---- .github/workflows/demo.yml | 71 ----- .github/workflows/docker.yml | 37 --- .github/workflows/docs.yml | 51 ---- .github/workflows/main.yml | 121 --------- .github/workflows/pr-labels.yml | 29 --- .github/workflows/pull_requests.yml | 32 --- .github/workflows/references.yml | 389 ---------------------------- .github/workflows/release.yml | 66 ----- .github/workflows/scripts.yml | 162 ------------ 10 files changed, 1009 deletions(-) delete mode 100644 .github/workflows/builds.yml delete mode 100644 .github/workflows/demo.yml delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/pr-labels.yml delete mode 100644 .github/workflows/pull_requests.yml delete mode 100644 .github/workflows/references.yml delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/scripts.yml diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml deleted file mode 100644 index 895c42cd68..0000000000 --- a/.github/workflows/builds.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: builds - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - python: ["3.8", "3.9"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - if: matrix.os == 'macos-latest' - name: Install MacOS prerequisites - run: brew install cairo pango gdk-pixbuf libffi - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'tensorflow' - name: Install package (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install package (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - name: Import package - run: python -c "import doctr; print(doctr.__version__)" diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml deleted file mode 100644 index 8f86d4f52c..0000000000 --- a/.github/workflows/demo.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: demo - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - test-demo: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - if: matrix.os == 'macos-latest' - name: Install MacOS prerequisites - run: brew install cairo pango gdk-pixbuf libffi - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('demo/tf-requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('demo/pt-requirements.txt') }} - - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -r demo/tf-requirements.txt - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -r demo/pt-requirements.txt - - - if: matrix.framework == 'tensorflow' - name: Run demo (TF) - env: - USE_TF: 1 - run: | - streamlit --version - screen -dm streamlit run demo/app.py - sleep 10 - curl http://localhost:8501/docs - - if: matrix.framework == 'pytorch' - name: Run demo (PT) - env: - USE_TORCH: 1 - run: | - streamlit --version - screen -dm streamlit run demo/app.py - sleep 10 - curl http://localhost:8501/docs diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 70507e4d05..0000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: docker - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - docker-package: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build docker image - run: docker build . -t doctr-tf-py3.8-slim - - name: Run docker container - run: docker run doctr-tf-py3.8-slim python3 -c 'import doctr' - - pytest-api: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Build & run docker - run: cd api && docker-compose up -d --build - - name: Ping server - run: wget --spider --tries=12 http://localhost:8080/docs - - name: Run docker test - run: | - docker-compose -f api/docker-compose.yml exec --no-TTY web pytest tests/ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 73000a7575..0000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: docs -on: - push: - branches: main - -jobs: - docs-deploy: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-docs - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[tf] - pip install -e .[docs] - - - name: Build documentation - run: cd docs && bash build.sh - - - name: Documentation sanity check - run: test -e docs/build/index.html || exit - - - name: Install SSH Client 🔑 - uses: webfactory/ssh-agent@v0.4.1 - with: - ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }} - - - name: Deploy to Github Pages - uses: JamesIves/github-pages-deploy-action@3.7.1 - with: - BRANCH: gh-pages - FOLDER: 'docs/build' - COMMIT_MESSAGE: '[skip ci] Documentation updates' - CLEAN: true - SSH: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 00a10786b9..0000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: tests - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - pytest-common: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-tests - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -e .[testing] - - name: Run unittests - run: | - coverage run -m pytest tests/common/ - coverage xml -o coverage-common.xml - - uses: actions/upload-artifact@v2 - with: - name: coverage-common - path: ./coverage-common.xml - if-no-files-found: error - - pytest-tf: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-tests - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -e .[testing] - - name: Run unittests - run: | - coverage run -m pytest tests/tensorflow/ - coverage xml -o coverage-tf.xml - - uses: actions/upload-artifact@v2 - with: - name: coverage-tf - path: ./coverage-tf.xml - if-no-files-found: error - - pytest-torch: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-tests - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -e .[testing] - - - name: Run unittests - run: | - coverage run -m pytest tests/pytorch/ - coverage xml -o coverage-pt.xml - - - uses: actions/upload-artifact@v2 - with: - name: coverage-pytorch - path: ./coverage-pt.xml - if-no-files-found: error - - codecov-upload: - runs-on: ubuntu-latest - needs: [ pytest-common, pytest-tf, pytest-torch ] - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - flags: unittests - fail_ci_if_error: true diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml deleted file mode 100644 index dc55bb1f4d..0000000000 --- a/.github/workflows/pr-labels.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: pr-labels - -on: - pull_request: - branches: main - types: closed - -jobs: - is-properly-labeled: - if: github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - - name: Install requests - run: pip install requests - - name: Process commit and find merger responsible for labeling - id: commit - run: echo "::set-output name=merger::$(python .github/verify_pr_labels.py ${{ github.event.pull_request.number }})" - - name: 'Comment PR' - uses: actions/github-script@0.3.0 - if: ${{ steps.commit.outputs.merger != '' }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { issue: { number: issue_number }, repo: { owner, repo } } = context; - github.issues.createComment({ issue_number, owner, repo, body: 'Hey ${{ steps.commit.outputs.merger }} 👋\nYou merged this PR, but it is not correctly labeled. The list of valid labels is available at https://github.com/mindee/doctr/blob/main/.github/verify_pr_labels.py' }); diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml deleted file mode 100644 index ade0d3a504..0000000000 --- a/.github/workflows/pull_requests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: pull_requests - -on: - pull_request: - branches: main - -jobs: - docs-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: "3.8" - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}-docs - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -e .[docs] - - - name: Build documentation - run: cd docs && bash build.sh - - - name: Documentation sanity check - run: test -e docs/build/index.html || exit diff --git a/.github/workflows/references.yml b/.github/workflows/references.yml deleted file mode 100644 index 572684fc01..0000000000 --- a/.github/workflows/references.yml +++ /dev/null @@ -1,389 +0,0 @@ -name: references - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - train-char-classification: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}- - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}- - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -r references/requirements.txt - sudo apt-get update && sudo apt-get install fonts-freefont-ttf -y - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -r references/requirements.txt - sudo apt-get update && sudo apt-get install fonts-freefont-ttf -y - - if: matrix.framework == 'tensorflow' - name: Train for a short epoch (TF) - run: python references/classification/train_tensorflow.py vit_s -b 32 --val-samples 1 --train-samples 1 --epochs 1 - - if: matrix.framework == 'pytorch' - name: Train for a short epoch (PT) - run: python references/classification/train_pytorch.py vit_s -b 32 --val-samples 1 --train-samples 1 --epochs 1 - - train-text-recognition: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}- - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}- - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -r references/requirements.txt - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -r references/requirements.txt - - name: Download and extract toy set - run: | - wget https://github.com/mindee/doctr/releases/download/v0.3.1/toy_recogition_set-036a4d80.zip - sudo apt-get update && sudo apt-get install unzip -y - unzip toy_recogition_set-036a4d80.zip -d reco_set - - if: matrix.framework == 'tensorflow' - name: Train for a short epoch (TF) - run: python references/recognition/train_tensorflow.py crnn_vgg16_bn --train_path ./reco_set --val_path ./reco_set -b 4 --epochs 1 - - if: matrix.framework == 'pytorch' - name: Train for a short epoch (PT) - run: python references/recognition/train_pytorch.py crnn_mobilenet_v3_small --train_path ./reco_set --val_path ./reco_set -b 4 --epochs 1 - - evaluate-text-recognition: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }} - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - if: matrix.framework == 'tensorflow' - name: Evaluate text recognition (TF) - run: python references/recognition/evaluate_tensorflow.py crnn_mobilenet_v3_small --dataset IIIT5K -b 32 - - if: matrix.framework == 'pytorch' - name: Evaluate text recognition (PT) - run: python references/recognition/evaluate_pytorch.py crnn_mobilenet_v3_small --dataset IIIT5K -b 32 - - latency-text-recognition: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }} - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - if: matrix.framework == 'tensorflow' - name: Benchmark latency (TF) - run: python references/recognition/latency_tensorflow.py crnn_vgg16_bn --it 5 - - if: matrix.framework == 'pytorch' - name: Benchmark latency (PT) - run: python references/recognition/latency_pytorch.py crnn_mobilenet_v3_small --it 5 - - train-text-detection: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }}- - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}-${{ hashFiles('references/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }}- - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -r references/requirements.txt - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -r references/requirements.txt - - name: Download and extract toy set - run: | - wget https://github.com/mindee/doctr/releases/download/v0.3.1/toy_detection_set-bbbb4243.zip - sudo apt-get update && sudo apt-get install unzip -y - unzip toy_detection_set-bbbb4243.zip -d det_set - - if: matrix.framework == 'tensorflow' - name: Train for a short epoch (TF) - run: python references/detection/train_tensorflow.py --train_path ./det_set --val_path ./det_set db_resnet50 -b 2 --epochs 1 - - if: matrix.framework == 'pytorch' - name: Train for a short epoch (PT) - run: python references/detection/train_pytorch.py ./det_set ./det_set db_mobilenet_v3_large -b 2 --epochs 1 - - evaluate-text-detection: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }} - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - pip install -r references/requirements.txt - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - pip install -r references/requirements.txt - - if: matrix.framework == 'tensorflow' - name: Evaluate text detection (TF) - run: python references/detection/evaluate_tensorflow.py db_mobilenet_v3_large - - if: matrix.framework == 'pytorch' - name: Evaluate text detection (PT) - run: python references/detection/evaluate_pytorch.py db_mobilenet_v3_large - - latency-text-detection: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [tensorflow, pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }} - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - if: matrix.framework == 'tensorflow' - name: Benchmark latency (TF) - run: python references/detection/latency_tensorflow.py linknet_resnet18 --it 5 --size 512 - - if: matrix.framework == 'pytorch' - name: Benchmark latency (PT) - run: python references/detection/latency_pytorch.py linknet_resnet18 --it 5 --size 512 - - latency-object-detection: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - framework: [pytorch] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('requirements-pt.txt') }} - - if: matrix.framework == 'tensorflow' - name: Install dependencies (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install dependencies (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - if: matrix.framework == 'pytorch' - name: Benchmark latency (PT) - run: python references/obj_detection/latency_pytorch.py fasterrcnn_mobilenet_v3_large_fpn --it 5 --size 512 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 37446c9c46..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: pypi-publish - -on: - release: - types: [published] - -jobs: - - pypi-publish: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Cache python modules - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine --upgrade - - name: Get release tag - id: release_tag - run: | - echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - VERSION: ${{ steps.release_tag.outputs.VERSION }} - run: | - BUILD_VERSION=$VERSION python setup.py sdist bdist_wheel - twine check dist/* - twine upload dist/* - - pypi-check: - if: "!github.event.release.prerelease" - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8"] - needs: pypi-publish - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Install package - run: | - python -m pip install --upgrade pip - pip install python-doctr - python -c "import doctr; print(doctr.__version__)" diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml deleted file mode 100644 index f8e8e3b11c..0000000000 --- a/.github/workflows/scripts.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: scripts - -on: - push: - branches: main - pull_request: - branches: main - -jobs: - test-analyze: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8", "3.9"] - framework: [tensorflow, pytorch] - steps: - - if: matrix.os == 'macos-latest' - name: Install MacOS prerequisites - run: brew install cairo pango gdk-pixbuf libffi - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'tensorflow' - name: Install package (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install package (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - - name: Run analysis script - run: | - wget https://github.com/mindee/doctr/releases/download/v0.1.0/sample.pdf - python scripts/analyze.py sample.pdf --noblock - - test-detect-text: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8", "3.9"] - framework: [tensorflow, pytorch] - steps: - - if: matrix.os == 'macos-latest' - name: Install MacOS prerequisites - run: brew install cairo pango gdk-pixbuf libffi - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'tensorflow' - name: Install package (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install package (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - - name: Run detection script - run: | - wget https://github.com/mindee/doctr/releases/download/v0.1.0/sample.pdf - python scripts/detect_text.py sample.pdf - - test-evaluate: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - python: ["3.8", "3.9"] - framework: [tensorflow, pytorch] - steps: - - if: matrix.os == 'macos-latest' - name: Install MacOS prerequisites - run: brew install cairo pango gdk-pixbuf libffi - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - if: matrix.framework == 'tensorflow' - name: Cache python modules (TF) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'pytorch' - name: Cache python modules (PT) - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pkg-deps-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} - - if: matrix.framework == 'tensorflow' - name: Install package (TF) - run: | - python -m pip install --upgrade pip - pip install -e .[tf] --upgrade - - if: matrix.framework == 'pytorch' - name: Install package (PT) - run: | - python -m pip install --upgrade pip - pip install -e .[torch] --upgrade - - name: Run evaluation script - run: | - python scripts/evaluate.py db_resnet50 crnn_vgg16_bn --samples 10 - python scripts/evaluate_kie.py db_resnet50 crnn_vgg16_bn --samples 10 - - test-collectenv: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.8", "3.9"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - architecture: x64 - - name: Run environment collection script - run: python scripts/collect_env.py