r/sideprojects • • Oct 26 '26

Showcase: Open Source I built an open-source Python SDK for local facial expression recognition

I've been working on ERML, an open-source Python SDK that runs facial expression recognition locally instead of relying on a hosted inference API.

The idea is simple: give it an image, get structured predictions back.

pip install erml

from erml import EmotionDetector

detector = EmotionDetector()
results = detector.analyze("photo.jpg")

print(results[0].emotion)
print(results[0].confidence)

ERML uses ONNX Runtime and currently supports seven facial-expression categories.

I want to eventually grow it into a broader human visual-perception toolkit for applications and AI agents, but it's still early.

I'm sharing it to get feedback from developers working with Python, computer vision, or local inference. I'd also like to make it easier for people to contribute.

GitHub: https://github.com/sid-lakhani/erml
Documentation: https://erml.sidlakhani.in

I'm the creator, so feedback and constructive criticism are welcome.

4 Upvotes

7 comments sorted by

1

u/prathamg4 Oct 26 '26

Could you show the return values for no face, several faces, and a low-confidence prediction in the quickstart? Those cases matter when wiring it into an app. A small CPU latency benchmark with the hardware and image size would also help people judge whether local inference fits their use case. I’d keep the wording focused on predicted facial expressions, since that alone does not establish someone’s internal emotional state.

1

u/sid-lakhani Oct 26 '26

Opened an issue for this: https://github.com/sid-lakhani/erml/issues/12. If anyone's up for tackling it, contributions are welcome!

1

u/sid-lakhani Oct 27 '26

Quick update: the edge-case docs and CPU benchmark are now merged, thanks to a contributor who picked up the issue.

1

u/prathamg4 29d ago

Thanks for coming back with the update, and credit to the contributor who picked it up. Having the edge cases and a reproducible CPU benchmark documented makes it much easier to decide whether the SDK fits an app. One useful regression check would be to keep small fixtures for no face and multiple faces, so future model or preprocessing changes don’t silently change the API’s return shape.

1

u/[unknown] Oct 26 '26

[removed] — view removed comment

1

u/sid-lakhani Oct 26 '26

Thanks, that's exactly the kind of feedback I was hoping to get! The goal was to keep the API simple and avoid making people deal with a bunch of setup just to run inference.

Would genuinely love to hear how it performs on webcam frames, especially if you run into any latency or accuracy issues. Let me know how it goes!