https://github.com/leocov-dev/cedar-detect-python
example python bindings for cedar-detect
https://github.com/leocov-dev/cedar-detect-python
Last synced: 3 months ago
JSON representation
example python bindings for cedar-detect
- Host: GitHub
- URL: https://github.com/leocov-dev/cedar-detect-python
- Owner: leocov-dev
- License: other
- Created: 2024-06-18T11:35:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T19:52:02.000Z (almost 2 years ago)
- Last Synced: 2024-12-31T18:43:00.622Z (over 1 year ago)
- Language: Rust
- Size: 4.75 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Cedar-Detect Python Bindings
> This project is a work in progress and not fully developed
This repository builds python bindings for the [cedar-detect](https://github.com/smroid/cedar-detect) rust library.
## Example
```shell
pip install cedar-detect-python
```
```python
import numpy as np
from PIL import Image
import cedar_detect
if __name__ == '__main__':
img = 'hale_bopp.jpg'
with Image.open(img) as img:
img = img.convert(mode='L')
summary = cedar_detect.algorithm.summarize_region_of_interest(
img.width,
img.height,
np.asarray(img, dtype=np.uint8).flatten(),
10, 10, 256, 256, 0.01, 0.01,
)
```
## Local Development
Requirements:
- Rust `1.79+`
- Python `3.7+`
- [Hatch](https://hatch.pypa.io/latest/install/)
- Install `hatch` following the procedure for your operating system.
Setup the project locally for development.
This will create a `.venv/` directory in the repository root.
```shell
hatch run setup
```
Run tests
```shell
hatch test
```
Run a release build to create wheels in the `dist/` directory
```shell
hatch build -t wheel
```