Skip to content

Commit

Permalink
refactor project (#32)
Browse files Browse the repository at this point in the history
* remove vviz

* remove cv namespace

* use sophus ImageSize

* attempt sophus MutImage

* refactor repo

* refactor python bindings

* improve build

* fix target

* try cross

* try actions-rs/cargo

* use cross flag

* try x86_64 only

* disable cross

* fix format

* keep trying

* keep trying

* enable cross compile

* use ndarray

* remove clone

* cargo fmt

* fixes in the ci

* add missing cross command

* move dockerfile

* move aarch64 docker

* add cargo

* use cargo action for clippy

* use cross

* use directly cross

* typo

* cargo action

* install manually nasm

* install manually nasm

* install manually nasm

* use clippy-check

* not use cross in clippy

* fixes

* update crate metadata

* add hello world example

* add examples and to grayscale

* add tests

* add benchmark

* add rust release workflow (#35)

* rename rust file

* Added deps

Signed-off-by: carlosb1 <mcflurry0@gmail.com>

* Add matrix

Signed-off-by: carlosb1 <mcflurry0@gmail.com>

* Adding multitarget and description

Signed-off-by: carlosb1 <mcflurry0@gmail.com>

* Added archicture wit the toolchain

Signed-off-by: carlosb1 <mcflurry0@gmail.com>

* Added release workflow

Signed-off-by: carlosb1 <mcflurry0@gmail.com>

---------

Signed-off-by: carlosb1 <mcflurry0@gmail.com>
Co-authored-by: Edgar Riba <edgar.riba@gmail.com>

* add benchmark

* implement bilinear interpolation

* add nearest neighbour

* some polishing

* simplify resize

* small fix

* attempt to fix ci

* use cargo nightly

* fix ci

* candle is optional

* pass images a reference

* implement cast

* clarify mutability

* small improvements

* add some more benchmarks

* small optimisation

* docs and cleanup

* add threshold, normalize

* add generics

* add generics

* add vanilla distance transform

* attempt improve image api

* image channels as generic

* make grayscale float only

* enable back resize

* revives stuff

* apply clippy

* add types in examples

* rename from_size

* add image docs

* builder resize options

* some tweaks in grayscale

* renable threshold

* more docs, io::functional

* add horizontal/vertical flip

* fix distance transform interface

* image size copy

* to numpy

* fix python and decompres api

* add python test workflow

* add dependencies

* add dev dependencies

* add torch cpu

* remove makefile filter

* fixes in ci

* check release workflow

* change working directory

* rest release workflow

* point to cargo

* enable push again

* bump crate 0.0.2

* Update Makefile

Co-authored-by: João Gustavo A. Amorim <joaogustavoamorim@gmail.com>

* Update py-kornia/pyproject.toml

Co-authored-by: João Gustavo A. Amorim <joaogustavoamorim@gmail.com>

* Update py-kornia/Cargo.toml

Co-authored-by: João Gustavo A. Amorim <joaogustavoamorim@gmail.com>

* update cargo toml/lock

* restore candle optional

* fix clippy

* rename python test

* pass image as reference

* fix reference

* rewrite readme

* small fix

* Update README.md

* add more emojis

* bit more improvement

---------

Signed-off-by: carlosb1 <mcflurry0@gmail.com>
Co-authored-by: Carlos B <mcflurry0@gmail.com>
Co-authored-by: João Gustavo A. Amorim <joaogustavoamorim@gmail.com>
  • Loading branch information
3 people authored Mar 9, 2024
1 parent 76d0261 commit 4470040
Show file tree
Hide file tree
Showing 61 changed files with 10,443 additions and 2,641 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Python Release

on:
release:
Expand All @@ -16,6 +16,7 @@ jobs:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
target: [x86_64, aarch64]

steps:
- uses: actions/checkout@v3
- name: Set up QEMU
Expand All @@ -33,7 +34,7 @@ jobs:
container: ghcr.io/kornia/kornia-rs/release-${{ matrix.target }}:latest
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist -i python${{ matrix.python-version }}
args: --release --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -63,7 +64,7 @@ jobs:
with:
maturin-version: latest
command: build
args: --target ${{ matrix.target }}-apple-darwin --release --out dist -i python${{ matrix.python-version }}
args: --target ${{ matrix.target }}-apple-darwin --release --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
with:
maturin-version: latest
command: build
args: --release --out dist -i python${{ matrix.python-version }}
args: --release --out dist -i python${{ matrix.python-version }} -m py-kornia/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Python Test

on:
pull_request:
paths:
- Cargo.lock
- py-kornia/**
- .github/workflows/test-python.yml
push:
branches:
- main
paths:
- Cargo.lock
- py-kornia/**
- .github/workflows/test-python.yml

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: sudo apt-get install -y cmake nasm
- name: Build and test
run: make test-python
61 changes: 61 additions & 0 deletions .github/workflows/rust_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Rust Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: sudo apt-get install -y cmake nasm
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
name: Clippy Output

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: --all --all-features
use-cross: true
35 changes: 35 additions & 0 deletions .github/workflows/rust_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Rust Release

on:
workflow_dispatch:
release:
types: [published]

jobs:
release:
name: Release Rust
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: sudo apt-get install -y cmake nasm
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: login
args: ${{ secrets.CARGO_REGISTRY_TOKEN_KORNIA }}
- name: Cargo Publish
uses: actions-rs/cargo@v1
with:
command: publish
args: --verbose --target ${{ matrix.target }}
37 changes: 37 additions & 0 deletions .github/workflows/rust_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Rust Test

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
# https://github.com/huggingface/candle/issues/1516
CUDA_COMPUTE_CAP: 75

jobs:
build_and_test:
name: Test Suite - ${{ matrix.target }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --target ${{ matrix.target }}
use-cross: true
74 changes: 3 additions & 71 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,72 +1,4 @@
/target

# Byte-compiled / optimized / DLL files
__pycache__/
.pytest_cache/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
.venv/
env/
bin/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
include/
man/
venv/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
pip-selfcheck.json

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Rope
.ropeproject

# Django stuff:
*.log
*.pot

.DS_Store

# Sphinx documentation
docs/_build/

# PyCharm
.idea/

# VSCode
.vscode/

# Pyenv
.python-version
.venv/
target/
docker/
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ repos:
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy
- id: fmt
Loading

0 comments on commit 4470040

Please sign in to comment.