AnimeFace-Unified-PE-Core-S16
fast anime face and micro-expression encoder
2 min readupdated
A new compact model based on Meta PE-Core-S/16 tackles character recognition and facial expression analysis using avatars or screenshots. In a single pass, it outputs a character identity vector, a micro-expression classifier, and a detailed residual facial expression embedding. Weighing as little as 15 MB (in MNN W4 quantized format), the model is well-suited for mobile applications, local utilities, and chat script processing. Released under the Apache-2.0 license, it outperforms heavier alternatives in accuracy while maintaining a smaller footprint.
Key features
- Weighs only 15.17 MiB in MNN W4 quantization with 24.2M parameters based on the PE-Core-S/16 architecture
- Simultaneous output of three independent representations (character ID, 48 micro-expression classes, and a detailed facial expression vector) in a single pass
- High accuracy of 0.8250 Macro AUROC in emotion classification, even for entirely new and unfamiliar characters
- Support for various export formats: ONNX, PyTorch safetensors, and ready-to-use MNN models for mobile devices
What you can do
- Integrate the model into a mobile or desktop application to search and match anime avatars
- Automatically recognize 48 types of micro-expressions and states (smile, blush, tears, surprise) from chat screenshots
- Use in text and comic processing pipelines to automatically generate emotion descriptions for images
Example
from PIL import Image
from inference import AnimeFaceUnifiedEncoder
enc = AnimeFaceUnifiedEncoder("onnx/model.onnx", "vocab_48.json")
e_id, probs, e_expr = enc.predict([Image.open("avatar.png")])
tags = enc.decode_expressions(probs[0], top_k=5)
print([(t["tag"], t["zh"], t["score"]) for t in tags])
Read more
Details• ID Top-1 accuracy on 1,099 skins: 97.5%
• CPU speed (4 threads): 37.9 ms per image
• Hardware requirements: minimal, optimized for mobile devices and CPU
• License: Apache-2.0










Comments