is-photo

Crates.iois-photo
lib.rsis-photo
version
sourcesrc
created_at2024-12-04 05:43:16.279146
updated_at2024-12-04 05:45:40.217654
descriptionUtility to determine if an image is likely a photograph or a 2D graphic
homepage
repositoryhttps://github.com/Lantern-chat/is-photo
max_upload_size
id1471237
Cargo.toml error:TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Nova (novacrazy)

documentation

https://docs.rs/is-photo

README

is-photo

crates.io Documentation MIT/Apache-2 licensed

Utility to determine if an image is likely a photograph or a 2D graphic, such as a logo, illustration, or digital art.

It does this by taking various statistics from the image and running them through a pre-trained logistic regression model, along with a few sure-fire heuristics.

On my test set of around 1500 images, it has a 94% accuracy rate. Feel free to submit links to additional image sets to train on in an issue!

Example

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let img = image::open("test.jpg")?;

let analysis = is_photo::analyze(&img).expect("Failed to analyze image");

let is_photo = analysis.is_photo(&is_photo::STANDARD_MODEL);
# Ok(()) }

Future work may include training on a larger dataset, and possibly using a full neural network instead of logistic regression.

Commit count: 6

cargo fmt