1. 15

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:

https://gitlab.com/azdle/stockfaces-api/ https://gitlab.com/azdle/stockfaces-web/

  1.  

  2. 3

    This is exactly what my sock puppet army needed! Thank you!

    1. 1

      I’m pretty sure you’re joking, but I did think about that when I was starting this. I basically came to the conclusion that unscrupulous people that are going to impersonate others probably aren’t going to care about stealing real peoples' avatars or what license a photo is under, so hopefully this just makes it easier for honest people.

      Plus every face I’ve reverse image searched has at least a few places already using the image and google seems to search by face so it finds the whole thing.