I needed to do some basic face detection for a project in an environment that had no access to the internet. It turned out to be surprisingly difficult to get a simple face detection server running locally. Either the code was outdated, wouldn't run in Docker, model was too big and slow, results were bad, license not permissive enough, it was too complicated, etc.<p>So I did some research and found that RetinaFace backed by ResNet50 is a good balance between speed and performance. It runs fast enough on CPU and still benefits from GPU and has close to state-of-the-art accuracy.<p>I took an implementation, stripped it, optimized it for inference, and put it behind a FastAPI API. If you ever need to do some quick and simple face detection I hope you can also make use of this!