Skip to content

Rust implementation + Python bindings for image effects used in chaiNNer

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

chaiNNer-org/chaiNNer-rs

Repository files navigation

Rust in chaiNNer

PyPI

This repository contains code to implement nodes for chaiNNer in Rust.

The main goals of this project are as follows:

  1. Provide high-performance implementations of algorithms that are not possible to implement efficiently in Python.
  2. Wrap existing Rust libraries.
  3. Provide cross-platform Python bindings for all of the above.

In essence, this project bridges the performance and compatibility gaps caused by Python.

Contributing

Install Rust and Python onto your machine. We recommend VSCode as the IDE of choice for writing Rust code.

Useful commands:

  • cargo check - check that the code compiles.
  • cargo clippy - check that the code compiles and passes numerous lints.
  • cargo test - run all tests.
  • cargo test --workspace --features snap-write - run all tests and overwrite outdated snapshots.
  • cargo bench - run all benchmarks.

Structure

This project consists of multiple crates:

  • bindings - Python bindings for the other crates.
  • image-core - The core interfaces used by the other crates.
  • image-ops - Implementations for image operations.
  • regex-py - Implementation for the regex API exposed by bindings.
  • test-util - Utilities for testing.

Testing the bindings

python install-locally.py

This will build the bindings and install them into the current Python environment. Start chaiNNer using npm run dev and it should use the new bindings.

About

Rust implementation + Python bindings for image effects used in chaiNNer

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published