Classify birds on your images using inceptionv3.
The plugin is nativaly developed in rust programming language.
Build the plugin.
cargo build --release
The file target/release/liblenna_birds_plugin.so can be copied to the plugins folder of
lenna-cli and used in the pipeline.
The plugin can be build with mobilenetv2.
cargo build --release --features mobilenet
The plugin can be build with efficientnetb2.
cargo build --release --no-default-features --features efficientnet
The plugin can be compiled to wasm and used on lenna.app.
Build the wasm package.
wasm-pack build
The node module can be build then.
npm run build
The plugin can be hosted using
npm run start
A server runs on localhost:3002 now.
On lenna.app on the left side the url http://localhost:3002 can be loaded to use the plugin.
The plugin can build python bindings.
Create a virtual environment for python.
virtualenv -p python3 .venv
source .venv/bin/activate
pip install .
Import lenna_birds_plugin in a python environment.
from PIL import Image
from numpy import asarray
import lenna_birds_plugin
print(lenna_birds_plugin.description())
image = Image.open('assets/Baird_Sparrow_0010_794575.jpg')
data = asarray(image)
print(data.shape)
config = lenna_birds_plugin.default_config()
print(config)
processed = lenna_birds_plugin.process(config, data)
print(processed.shape)
Image.fromarray(processed).save('lenna_test_out.png')
Run the python test file which loads the Baird_Sparrow_0010_794575.jpg and converts it.
pip install pillow numpy
python src/test.py
Find an example in example.ipynb
pip install jupyter
jupyter notebook example.ipynb
Thanks to gpiosenka for the dataset.
Thanks to dennisjooo for the efficientnet model.