Howdy all, this is a small tool I put together that I hope others can find useful.
A few weeks ago, I was really inspired to make a desktop native client for Matrix.org chat. I decided to do it in rust, but then found that there was a library for matrix clients already in progress, so I decided to start with the UI. While working on that I decided that I wanted some pictures of people to use as avatars. But I discovered that when I went searching for them that I couldn’t find anything that was free, high quality, and having an explicit license, so I decided to fix that.
For the photos, I’m using Unsplash. It’s is a great service that provides CC0 stock images that are mostly really high quality, so now I had a source for the faces. I then found a python machine learning library that had a face detection algorithm built in. I just ran every single Unsplash image through the face detector, doubled the bounding box and set a crop for just that face. I did have to go back through an clean up a bunch of things it thought were faces but weren’t or faces that were obscured or low quality.
With the faces' URLs pushed into a sqlite DB I then made a backend server in rust to serve the image links (I’m thinking I might want to track popularity if people end up using this) and the paginated JSON for image info.
Next I wrote the front end in Elm, mostly just because I’d been meaning to try it for months now and every time I do a React/Redux app I get annoyed at how much boiler-plate & repetition I takes to write something.
If you want, you can checkout the (still pretty messy) source here: