diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9968617..cdcc037 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,77 +14,43 @@ concurrency: jobs: test: - name: Run tutorials - ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.pytorch-version }} - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false matrix: - os: ['Ubuntu'] - python-version: ['3.8', '3.10'] - pytorch-version: ['2.0.1'] - - steps: - - uses: actions/checkout@v3 - - - name: Setup environment - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install pytorch - shell: bash - run: pip install torch==${{ matrix.pytorch-version }} torchvision --index-url https://download.pytorch.org/whl/cpu - + kornia-ref: ['main'] # TODO: coverage check through multiple versions: , 'v0.7.1', 'v0.7.0'] - - name: Install dependencies - shell: bash -l {0} - run: | - pip install -r requirements.txt --upgrade - pip install -r requirements-dev.txt --upgrade - - - name: Check deps - shell: bash -l {0} - run: make check-deps - - - name: Generate tutorials - shell: bash -l {0} - run: make generate - - - name: Run tutorials - shell: bash -l {0} - run: make execute + uses: kornia/workflows/.github/workflows/tutorials.yml@v1.4.1 + with: + ref: ${{ matrix.kornia-ref }} build: needs: test - name: Build tutorials - ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.pytorch-version }} + name: Build tutorials runs-on: ${{ matrix.os }}-latest strategy: matrix: - os: ['Ubuntu'] - python-version: ['3.10'] - pytorch-version: ['2.0.1'] + os: ['ubuntu'] + kornia-ref: ['main'] steps: - - uses: actions/checkout@v3 + - uses: kornia/workflows/.github/actions/env@v1.4.1 + with: + ref: ${{ matrix.kornia-ref }} - - name: Setup conda dependencies - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} + repository: 'kornia/tutorials' + path: 'tutorials-repo/' - name: Install dependencies + working-directory: ./tutorials-repo/ shell: bash -l {0} - run: | - conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly -c pytorch - pip install -r requirements.txt --upgrade - pip install -r requirements-dev.txt --upgrade + run: make setup - uses: quarto-dev/quarto-actions/setup@v2 - name: Check deps + working-directory: ./tutorials-repo/ shell: bash -l {0} run: make check-deps @@ -92,4 +58,4 @@ jobs: uses: quarto-dev/quarto-actions/render@v2 with: to: html - path: . + path: ./tutorials-repo/ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 67ccc7c..634e66a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,40 +10,38 @@ jobs: runs-on: ${{ matrix.os }}-latest strategy: - fail-fast: true matrix: - os: ['Ubuntu'] - python-version: ['3.10'] - pytorch-version: ['2.0.1'] + os: ['ubuntu'] + kornia-ref: ['main'] steps: - - uses: actions/checkout@v3 - - name: Setup conda dependencies - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - shell: bash -l {0} - run: | - conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly -c pytorch - pip install -r requirements.txt - pip install -r requirements-dev.txt; - - - uses: quarto-dev/quarto-actions/setup@v2 - - - name: Render Quarto Project - uses: quarto-dev/quarto-actions/render@v2 - with: - to: html - path: . - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - force_orphan: true - publish_dir: ./_site - user_name: github-actions[bot] - user_email: 41898282+github-actions[bot]@users.noreply.github.com + - uses: kornia/workflows/.github/actions/env@v1.4.1 + with: + ref: ${{ matrix.kornia-ref }} + + - uses: actions/checkout@v4 + with: + repository: 'kornia/tutorials' + path: 'tutorials-repo/' + + - name: Install dependencies + working-directory: ./tutorials-repo/ + shell: bash -l {0} + run: make setup + + - uses: quarto-dev/quarto-actions/setup@v2 + + - name: Render Quarto Project + uses: quarto-dev/quarto-actions/render@v2 + with: + to: html + path: ./tutorials-repo/ + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + force_orphan: true + publish_dir: ./_site + user_name: github-actions[bot] + user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 107ebee..1be4560 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,9 +20,3 @@ repos: args: ['--profile=black'] - id: nbqa-black args: ['--nbqa-dont-skip-bad-cells', '--line-length=128'] - -- repo: https://github.com/fastai/nbdev/ - rev: 2.3.13 - hooks: - - id: nbdev_clean - args: ['--fname', './'] diff --git a/Makefile b/Makefile index 878d670..81ce091 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ setup-quarto: setup: pip install -r requirements.txt && pip install -r requirements-dev.txt; - make setup-quarto preview: quarto preview . diff --git a/README.md b/README.md index 5b4fcf7..27074d5 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ $ make preview $ quarto preview . ``` -For Linux users, you can use the `make setup` which will download and install the quarto binary for linux. And pip install -the requirements. +For Linux users, you can use the `make setup-quarto` which will download and install the quarto binary for linux. +And the `make setup` which will pip install the requirements. ### How to add a new tutorial diff --git a/nbs/aliased_and_not_aliased_patch_extraction.ipynb b/nbs/aliased_and_not_aliased_patch_extraction.ipynb index 37fae7d..9684b52 100644 --- a/nbs/aliased_and_not_aliased_patch_extraction.ipynb +++ b/nbs/aliased_and_not_aliased_patch_extraction.ipynb @@ -26,7 +26,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/canny.ipynb b/nbs/canny.ipynb index f7d86a1..4a91f0f 100644 --- a/nbs/canny.ipynb +++ b/nbs/canny.ipynb @@ -39,7 +39,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/color_conversions.ipynb b/nbs/color_conversions.ipynb index 3270c78..22bc958 100644 --- a/nbs/color_conversions.ipynb +++ b/nbs/color_conversions.ipynb @@ -24,7 +24,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/color_raw_to_rgb.ipynb b/nbs/color_raw_to_rgb.ipynb index 217193d..24b9536 100644 --- a/nbs/color_raw_to_rgb.ipynb +++ b/nbs/color_raw_to_rgb.ipynb @@ -31,7 +31,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/color_yuv420_to_rgb.ipynb b/nbs/color_yuv420_to_rgb.ipynb index 0807370..90af369 100644 --- a/nbs/color_yuv420_to_rgb.ipynb +++ b/nbs/color_yuv420_to_rgb.ipynb @@ -31,7 +31,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/connected_components.ipynb b/nbs/connected_components.ipynb index 79f3bb1..1c21166 100644 --- a/nbs/connected_components.ipynb +++ b/nbs/connected_components.ipynb @@ -26,7 +26,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/data_augmentation_2d.ipynb b/nbs/data_augmentation_2d.ipynb index ab37432..bf7ad3b 100644 --- a/nbs/data_augmentation_2d.ipynb +++ b/nbs/data_augmentation_2d.ipynb @@ -35,7 +35,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/data_augmentation_kornia_lightning.ipynb b/nbs/data_augmentation_kornia_lightning.ipynb index a34539b..ee5155b 100644 --- a/nbs/data_augmentation_kornia_lightning.ipynb +++ b/nbs/data_augmentation_kornia_lightning.ipynb @@ -33,7 +33,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/data_augmentation_mosiac.ipynb b/nbs/data_augmentation_mosiac.ipynb index e43a565..7031cc3 100644 --- a/nbs/data_augmentation_mosiac.ipynb +++ b/nbs/data_augmentation_mosiac.ipynb @@ -26,7 +26,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/data_augmentation_segmentation.ipynb b/nbs/data_augmentation_segmentation.ipynb index 623982d..4c2aceb 100644 --- a/nbs/data_augmentation_segmentation.ipynb +++ b/nbs/data_augmentation_segmentation.ipynb @@ -35,7 +35,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/data_augmentation_sequential.ipynb b/nbs/data_augmentation_sequential.ipynb index cb98afb..2fdd66d 100644 --- a/nbs/data_augmentation_sequential.ipynb +++ b/nbs/data_augmentation_sequential.ipynb @@ -34,7 +34,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "!pip install kornia\n", diff --git a/nbs/data_patch_sequential.ipynb b/nbs/data_patch_sequential.ipynb index 6d99bc4..8b60851 100644 --- a/nbs/data_patch_sequential.ipynb +++ b/nbs/data_patch_sequential.ipynb @@ -35,7 +35,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "!pip install kornia\n", diff --git a/nbs/descriptors_matching.ipynb b/nbs/descriptors_matching.ipynb index db612d1..a9898d4 100644 --- a/nbs/descriptors_matching.ipynb +++ b/nbs/descriptors_matching.ipynb @@ -37,7 +37,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/extract_combine_patches.ipynb b/nbs/extract_combine_patches.ipynb index e719b39..2966c10 100644 --- a/nbs/extract_combine_patches.ipynb +++ b/nbs/extract_combine_patches.ipynb @@ -33,7 +33,11 @@ "cell_type": "code", "execution_count": null, "id": "611b350e", - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/face_detection.ipynb b/nbs/face_detection.ipynb index c5cad7e..5e9bc45 100644 --- a/nbs/face_detection.ipynb +++ b/nbs/face_detection.ipynb @@ -25,7 +25,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/filtering_edges.ipynb b/nbs/filtering_edges.ipynb index 3cf82b1..fcca131 100644 --- a/nbs/filtering_edges.ipynb +++ b/nbs/filtering_edges.ipynb @@ -26,7 +26,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/filtering_operators.ipynb b/nbs/filtering_operators.ipynb index 588fba6..944f88f 100644 --- a/nbs/filtering_operators.ipynb +++ b/nbs/filtering_operators.ipynb @@ -27,7 +27,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/gaussian_blur.ipynb b/nbs/gaussian_blur.ipynb index 63e32cb..b5c6c63 100644 --- a/nbs/gaussian_blur.ipynb +++ b/nbs/gaussian_blur.ipynb @@ -39,7 +39,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/geometric_transforms.ipynb b/nbs/geometric_transforms.ipynb index 9ffc968..f8a2c3b 100644 --- a/nbs/geometric_transforms.ipynb +++ b/nbs/geometric_transforms.ipynb @@ -64,7 +64,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/geometry_generate_patch.ipynb b/nbs/geometry_generate_patch.ipynb index c56c0f8..e69b5ab 100644 --- a/nbs/geometry_generate_patch.ipynb +++ b/nbs/geometry_generate_patch.ipynb @@ -24,7 +24,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/hello_world_tutorial.ipynb b/nbs/hello_world_tutorial.ipynb index 2a6c412..65cedd7 100644 --- a/nbs/hello_world_tutorial.ipynb +++ b/nbs/hello_world_tutorial.ipynb @@ -33,7 +33,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/homography.ipynb b/nbs/homography.ipynb index 283a953..eed6d9a 100644 --- a/nbs/homography.ipynb +++ b/nbs/homography.ipynb @@ -24,7 +24,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_enhancement.ipynb b/nbs/image_enhancement.ipynb index ee32542..f5bfe5d 100644 --- a/nbs/image_enhancement.ipynb +++ b/nbs/image_enhancement.ipynb @@ -23,7 +23,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_histogram.ipynb b/nbs/image_histogram.ipynb index 2bba07a..d690bb1 100644 --- a/nbs/image_histogram.ipynb +++ b/nbs/image_histogram.ipynb @@ -31,7 +31,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_matching.ipynb b/nbs/image_matching.ipynb index c9f3d17..073ebd7 100644 --- a/nbs/image_matching.ipynb +++ b/nbs/image_matching.ipynb @@ -40,7 +40,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_matching_adalam.ipynb b/nbs/image_matching_adalam.ipynb index c83936a..daea04f 100644 --- a/nbs/image_matching_adalam.ipynb +++ b/nbs/image_matching_adalam.ipynb @@ -42,7 +42,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_matching_disk.ipynb b/nbs/image_matching_disk.ipynb index 1b535c9..f89e99c 100644 --- a/nbs/image_matching_disk.ipynb +++ b/nbs/image_matching_disk.ipynb @@ -41,7 +41,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_matching_lightglue.ipynb b/nbs/image_matching_lightglue.ipynb index 526f554..56082c1 100644 --- a/nbs/image_matching_lightglue.ipynb +++ b/nbs/image_matching_lightglue.ipynb @@ -40,7 +40,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_points_transforms.ipynb b/nbs/image_points_transforms.ipynb index a3b0a3e..d7591ca 100644 --- a/nbs/image_points_transforms.ipynb +++ b/nbs/image_points_transforms.ipynb @@ -35,7 +35,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_prompter.ipynb b/nbs/image_prompter.ipynb index c6065d8..3bbf7e8 100644 --- a/nbs/image_prompter.ipynb +++ b/nbs/image_prompter.ipynb @@ -67,7 +67,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_registration.ipynb b/nbs/image_registration.ipynb index 2f2d465..269d915 100644 --- a/nbs/image_registration.ipynb +++ b/nbs/image_registration.ipynb @@ -32,7 +32,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/image_stitching.ipynb b/nbs/image_stitching.ipynb index b5fcd8e..e7cc872 100644 --- a/nbs/image_stitching.ipynb +++ b/nbs/image_stitching.ipynb @@ -39,7 +39,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/line_detection_and_matching_sold2.ipynb b/nbs/line_detection_and_matching_sold2.ipynb index 77d40c9..b271d72 100644 --- a/nbs/line_detection_and_matching_sold2.ipynb +++ b/nbs/line_detection_and_matching_sold2.ipynb @@ -36,7 +36,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/morphology_101.ipynb b/nbs/morphology_101.ipynb index 03484da..6fe2aa6 100644 --- a/nbs/morphology_101.ipynb +++ b/nbs/morphology_101.ipynb @@ -50,7 +50,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/rotate_affine.ipynb b/nbs/rotate_affine.ipynb index 27ab24f..dfea3e5 100644 --- a/nbs/rotate_affine.ipynb +++ b/nbs/rotate_affine.ipynb @@ -24,7 +24,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/total_variation_denoising.ipynb b/nbs/total_variation_denoising.ipynb index 45142ee..9d5c7a5 100644 --- a/nbs/total_variation_denoising.ipynb +++ b/nbs/total_variation_denoising.ipynb @@ -25,7 +25,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/unsharp_mask.ipynb b/nbs/unsharp_mask.ipynb index cdb5a99..6b3c37f 100644 --- a/nbs/unsharp_mask.ipynb +++ b/nbs/unsharp_mask.ipynb @@ -34,7 +34,11 @@ "cell_type": "code", "execution_count": null, "id": "db9c144f", - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/warp_perspective.ipynb b/nbs/warp_perspective.ipynb index a92605a..4a0822f 100644 --- a/nbs/warp_perspective.ipynb +++ b/nbs/warp_perspective.ipynb @@ -31,7 +31,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n", diff --git a/nbs/zca_whitening.ipynb b/nbs/zca_whitening.ipynb index b113b8f..c1960c3 100644 --- a/nbs/zca_whitening.ipynb +++ b/nbs/zca_whitening.ipynb @@ -30,7 +30,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip-execution" + ] + }, "outputs": [], "source": [ "%%capture\n",