speciesnet-cli is a CLI for running a cameratrapai ensemble written in Rust.
cargo install --git https://github.com/zubalis/speciesnet-rust.git --path speciesnet-clidownload-model, enabled by default, downloads the ONNX-converted detector and classifier model automatically to be used, you will have to manually pass the path to the extracted model folder in order to run the program if this feature is turned off.
The CLI is designed to be pretty similar to how google/cameratrapai is, except there are some differences as we're working towards the python equivalent.
- The input instance file only support
filepath,country, andadmin1_regionkeys. - The classifier output only support the
classes, andscoreskey. - Other keys of
predictionsare still not supported on both reading from and writing to files. - The Rust version does not override or edit an existing
predictions.jsonfile, if one is found when supplied using--predictions-json, CLI will error saying the file already existed. - The CLI flag
--countryand--admin1-regioncurrently does nothing to the input.
The following examples show how to run speciesnet-cli compared to cameratrapai.
# cameratrapai.
python3 -m speciesnet.scripts.run_model --instance_json ./instances.json --predictions_json ./predictions.json --detector_only
# speciesnet-rust.
speciesnet-cli --instances-json ./instances.json --predictions-json ./predictions.json --detector-only# cameratrapai.
python3 -m speciesnet.scripts.run_model --instance_json ./instances.json --predictions_json ./predictions.json --classifier_only
# speciesnet-rust.
speciesnet-cli --instances-json ./instances.json --predictions-json ./predictions.json --classifier-only# cameratrapai.
python3 -m speciesnet.scripts.run_model --instance_json ./instances.json --classifications_json ./output_classifier.json --detections_json ./output_detector.json --predictions_json ./predictions.json --ensemble_only
# speciesnet-rust.
speciesnet-cli --instances-json ./instances.json --classifications-json ./output_classifier.json --detections-json ./output_detector.json --predictions-json ./predictions.json --ensemble-only# cameratrapai.
python3 -m speciesnet.scripts.run_model --instance_json ./instances.json --predictions_json ./predictions.json
# speciesnet-rust.
speciesnet-cli --instances-json ./instances.json --predictions-json ./predictions.json