Model reference · open weights

resmasknet

Embeddings py-feat Image embed 1 build Open weights 6k dl/mo

resmasknet is an open-weight embedding model from py-feat. resmasknet (BF16) weighs 552 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • resmasknet is a convolutional neural network developed by py-feat for image feature extraction.
  • It predicts seven facial emotion categories from 224x224 pixel inputs using a residual masking architecture with a u-network.
  • The model is built with PyTorch and released under the MIT license.

Summary of the py-feat/resmasknet model card, 2026-10-01

What it is

Released bypy-feat
Released2024-07-26
VRAM552 MB for the weights

What it runs on

Memory and cards for resmasknet (BF16)

552 MBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What py-feat says about resmasknet

Read the model card

Model Description

resmasknet combines residual masking with unet architecture to predict 7 facial emotion categories from images.

Model Details

  • Model Type: Convolutional Neural Network (CNN)
  • Architecture: Residual masking network with u-network. Output layer classifies 7 emotion categories
  • Input Size: 224x224 pixels
  • Framework: PyTorch

Model Sources

Citation

If you use the svm_au model in your research or application, please cite the following paper:

Pham Luan, The Huynh Vu, and Tuan Anh Tran. "Facial Expression Recognition using Residual Masking Network". In: Proc. ICPR. 2020.

@inproceedings{pham2021facial,
  title={Facial expression recognition using residual masking network},
  author={Pham, Luan and Vu, The Huynh and Tran, Tuan Anh},
  booktitle={2020 25th International Conference on Pattern Recognition (ICPR)},
  pages={4513--4519},
  year={2021},
  organization={IEEE}
}

Acknowledgements

We thank Luan Pham for generously sharing this model with a permissive license.

Example Useage

import numpy as np
import torch
import torch.nn as nn
from feat.emo_detectors.ResMaskNet.resmasknet_test import ResMasking
from huggingface_hub import hf_hub_download

# Load Configs
emotion_config_file = hf_hub_download(repo_id= "py-feat/resmasknet", filename="config.json", cache_dir=get_resource_path())
with open(emotion_config_file, "r") as f:
    emotion_config = json.load(f)

device = 'cpu'
emotion_detector = ResMasking("", in_channels=emotion_config['in_channels'])
emotion_detector.fc = nn.Sequential(nn.Dropout(0.4), nn.Linear(512, emotion_config['num_classes']))
emotion_model_file = hf_hub_download(repo_id='py-feat/resmasknet', filename="ResMaskNet_Z_resmasking_dropout1_rot30.pth")
emotion_checkpoint = torch.load(emotion_model_file, map_location=device)["net"]
emotion_detector.load_state_dict(emotion_checkpoint)
emotion_detector.eval()
emotion_detector.to(device)

# Test model
face_image = "path/to/your/test_image.jpg"  # Replace with your extracted face image that is [224, 224]

# Classification - [angry, disgust, fear, happy, sad, surprise, neutral]
emotions = emotion_detector.forward(face_image)
emotion_probabilities = torch.softmax(emotions, 1)

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

How it works

How embedding models work

Your textsentence / documentEncodermaps meaningVectorlist of numbersAn embedding model turns text into a vector, so similar meanings sit close together, which is the basis of search and RAG.
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms