Skip to content

Tries to deduce if an image is a photograph or digital art

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

Lantern-chat/is-photo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tries to deduce if an image is a photograph or digital art

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

Packages

No packages published

Languages