Low level implementations for computer vision in Rust
Project description
kornia-rs: Low level implementations for Computer Vision in Rust.
(🚨 Warning: Unstable Prototype 🚨)
The expectation of this project is to provide low level functionality for Computer Vision written in Rust to be consumed by deep learning frameworks, specially those working with images. We mainly provide I/O for images (future: video, cameras) and visualisation.
The library is written in Rust and wrapped to Python (potentially later to C/C++) using PyO3/Maturin. The library can also be used as a standalone Rust crate.
Basic Usage
Load an image, that is converted to cv::Tensor wich is designed centric
to the DLPack protocol to share tensor data across deep learning frameworks with a zero-copy cost.
The visualisation API is based on vviz: https://github.com/strasdat/vviz
import kornia_rs as K
from kornia_rs import Tensor as cvTensor
cv_tensor: cvTensor = K.read_image_jpeg("dog.jpeg")
assert cv_tensor.shape == [195, 258, 3]
# convert to dlpack to import to torch and numpy
# NOTE: later we will support to jax and mxnet.
th_tensor = torch.utils.dlpack.from_dlpack(cv_tensor)
np_tensor = np._from_dlpack(cv_tensor)
assert th_tensor.shape == (195, 258, 3)
assert np_tensor.shape == (195, 258, 3)
TODO
- [infra] Automate packaging for manywheels.
- [io] Implement image encoding and explore video.
- [viz] Fix minor issues and implement a full
VizManagerto work on the browser. - [dlpack] implement
DLPacktocv::Tensor. - [dlpack] implement test for numpy, jax and mxnet.
- [tensor] implement basic functionality to test: add, sub, mul, etc.
- [tensor] explore xnnpack and openvino integration.
- [kornia] integrate with the new
ImageAPI
Development
To test the project in lyour local machine use the following instructions:
- Clone the repository in your local directory
git clone https://github.com/kornia/kornia-rs.git
- Build the
devel.Dockerfile
Let's prepare the development environment with Docker. Make sure you have docker in your system: https://docs.docker.com/engine/install/ubuntu/
cd ./docker && ./build_devel.sh
KORNIA_RS_DEVEL_IMAGE="kornia_rs/devel:local" ./devel.sh
- Build the project
(you should now be inside the docker container)
# maturin needs you to be a `venv`
python3 -m venv .venv
source .venv/bin/activate
# build and generate linked wheels
maturin develop --extras dev
- Run the tests
pytest test/
Contributing
This is a child project of Kornia. Join the community to get in touch with us, or just sponsor the project: https://opencollective.com/kornia
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kornia_rs-0.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: kornia_rs-0.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.7.0 requests/2.27.1 setuptools/60.9.3 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df1d0f2909927ba170597d33243f48c00dfae83659d11240c4576d47877209e5
|
|
| MD5 |
bb9b537f54cf79e86578ae2d6ab331fa
|
|
| BLAKE2b-256 |
24778d16dfbf3e04ede360b3fad2ef8a0ceda446faff86e1c0971b4b2df4630b
|
File details
Details for the file kornia_rs-0.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: kornia_rs-0.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.7.0 requests/2.27.1 setuptools/60.9.3 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9636ca8b44ce16f3b4598ef1f9ebd2748097dfc3c8e8aae6620985277b1e815
|
|
| MD5 |
77572b6048ef1f1c7f89fe76ec4fb6d1
|
|
| BLAKE2b-256 |
3e78bc6b4e0f73bd94e0d62cd9451e8b975b30fbaeef3ac4e590cf9a0992198c
|
File details
Details for the file kornia_rs-0.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: kornia_rs-0.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.7.0 requests/2.27.1 setuptools/60.9.3 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66236ae49a92b8ccbb00a8c0fb0cab4d498c851f29ec69aa72712ca6bbe77101
|
|
| MD5 |
e49ff6bd3b4ee32b6bf253ca6ec830f5
|
|
| BLAKE2b-256 |
d7ec0aef0f6abd7714d5669063fc226667deb046095df1a711e3a7a469896f56
|