-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate tutorial to use the quarto framework (#63)
* Minimal quarto setup (#56) minimal setup to generate the tutorials with quarto * Add front matter (#57) * add missing front matters (#58) * add thumbnails (#59) * fix typo categories tags (#60) * Update theme customization (#61) Co-authored-by: Paolla Olsen <paollaolsen@gmail.com> * move to quarto actions * cleanup * add contribution guide --------- Co-authored-by: Paolla Olsen <paollaolsen@gmail.com>
- Loading branch information
1 parent
355d33b
commit 4f5e239
Showing
102 changed files
with
1,044 additions
and
824 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tutorials/assets/* binary | ||
tutorial/_static/img/* binary |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Generate docs and deploy to GitHub Pages | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy tutorials - ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.pytorch-version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: ['Ubuntu'] | ||
python-version: ['3.10'] | ||
pytorch-version: ['2.0.1'] | ||
|
||
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 |
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
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,126 @@ | ||
# tutorials | ||
# Kornia tutorials | ||
|
||
## development | ||
The kornia tutorials provide from basic to advanced tutorials for [kornia library](https://github.com/kornia/kornia). | ||
|
||
To compile the docs in local to debug | ||
These tutorials are made by the community for the community. To shows how to use the Kornia API, and also show how these | ||
computer vision algorithms can be used in a variety of scenarios. | ||
|
||
```bash | ||
make setup | ||
make build | ||
The kornia tutorials uses the [quarto](https://quarto.org/) framework to generate the website from jupyter notebooks. | ||
|
||
## Guide | ||
|
||
|
||
### Step-by-step setup environment | ||
1. Install [quarto](https://quarto.org/) following the official docs: https://quarto.org/docs/get-started/ | ||
1. Create a virtual environment | ||
```console | ||
# with virtual env | ||
$ virtualenv venv -p python3.10 | ||
# with conda | ||
$ conda create -p venv python=3.10 | ||
``` | ||
1. Install the dependencies | ||
```console | ||
$ pip install -r requirements.txt | ||
$ pip install -r requirements-dev.txt | ||
``` | ||
1. Run quarto on preview mode. Which automatically reloads the browser when input files or document resources change. | ||
```console | ||
# Using our makefile command | ||
$ make preview | ||
# Using the quarto cli directly | ||
$ 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. | ||
|
||
### How to add a new tutorial | ||
|
||
The kornia tutorials are jupyter notebooks (you can find them into [./nbs/](./nbs/) directory). Each notebook corresponds into a | ||
"blogpost" page within the same content. The notebook is compiled into a webpage by quarto, which means you can write a | ||
tutorial using a jupyter notebook with the normal pattern of Python and Markdown cells. This enable some special features | ||
, for use it we recomment you to check the [quarto docs](https://quarto.org/docs/). | ||
|
||
Aside from the content of the tutorial, the first cell of the notebook should have a header content (markdown cell). This header | ||
allow us to have thumbmail, author, categories, etc. This header should look like: | ||
|
||
```txt | ||
--- | ||
title: "<YOUR TUTORIAL TITLE HERE>" | ||
description: "<YOUR TUTORIAL DESCRIPTION HERE>" | ||
author: | ||
- "<YOUR NAME HERE>" | ||
date: "<TUTORIAL DATE INTO FORMAT MM-DD-YYYY>" | ||
categories: | ||
- "<CATEGORY HERE: basic, itermediate or advanced>" | ||
- "<CATEGORY HERE, based on the kornia module used: kornia.color, kornia.augmentation, etc>" | ||
- "<OTHER CATEGORY: checkout the readme list of categories>" | ||
- "<OTHER CATEGORY: checkout the readme list of categories>" | ||
- "<OTHER CATEGORY: checkout the readme list of categories>" | ||
image: "../tutorials/assets/<YOUR TUTORIAL THUMBMAIL FILENAME HERE>.png" | ||
--- | ||
<a href="https://colab.sandbox.google.com/github/kornia/tutorials/blob/master/nbs/<YOUR TUTORIAL FILENAME HERE>.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in google colab"></a> | ||
``` | ||
|
||
For this header you should generate a image to be used as thumbmail, and save it into the [tutorials/assets/](./tutorials/assets/) | ||
directory. Also update the link for the colab, for user can be able to directly open your tutorial into the colab. You can add | ||
`N` categories, look at the categories already available in the README, if you want to use a different one, please update the | ||
README too. | ||
|
||
|
||
### Tutorials categories | ||
If you add a new category on the tutorials frontmatter, update this too. | ||
|
||
By Levels | ||
- Basic | ||
- Intermediate | ||
- Advanced | ||
|
||
By module | ||
- kornia.augmentation | ||
- Kornia.feature | ||
- kornia.contrib | ||
- kornia.filters | ||
- kornia.color | ||
- kornia.io | ||
- kornia.geometry | ||
- kornia.enhance | ||
|
||
By generic type/category | ||
- Data augmentation | ||
- Segmentation | ||
- Edge Detection | ||
- Labeling | ||
- Denoising | ||
- Color spaces | ||
- Local features | ||
- Filters | ||
- Blur | ||
- Line | ||
- Plane | ||
- Keypoints | ||
- Homography | ||
- Image matching | ||
- Image Registration | ||
- Warp image | ||
- Augmentation container | ||
- Augmentation Sequential | ||
- Line detection | ||
- Line matching | ||
- Rescale | ||
- Affine | ||
- 2D | ||
- Unsupervised | ||
- Self-supervised | ||
|
||
By specific names of models / API | ||
- SOLD2 | ||
- KeyNet | ||
- Adalam | ||
- HardNet | ||
- DISK | ||
- Patches | ||
- LAF | ||
- LoFTR |
Oops, something went wrong.