
Show HN: Stock Faces, High Quality Faces for Mock Avatars - azdle
https://stockfaces.com
======
azdle
Howdy all, this is a small tool I put together that I thought could be helpful
to others here.

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.

Unsplash is a great service that provides CC0 stock images that are mostly
really high quality, so 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 Unspalsh image through the face detector, doubled the
bounding box and set a crop for just that person.

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-api/)

[https://gitlab.com/azdle/stockfaces-
web/](https://gitlab.com/azdle/stockfaces-web/)

