StyleID: A Perception-Aware Dataset and Metric for Stylization-Agnostic Facial Identity Recognition
Paper β’ 2604.21689 β’ Published β’ 27
Run kwanY/styleid on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/kwanY/styleid. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/kwanY/styleid on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use kwanY/styleid with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("zero-shot-image-classification", model="kwanY/styleid")
pipe(
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png",
candidate_labels=["animals", "humans", "landscape"],
) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForZeroShotImageClassification
processor = AutoProcessor.from_pretrained("kwanY/styleid")
model = AutoModelForZeroShotImageClassification.from_pretrained("kwanY/styleid", device_map="auto")StyleID is a CLIP-based image encoder trained to produce identity embeddings that are robust to stylization.
It can be used for identity similarity, retrieval, evaluation, and conditioning in generative models.
pip install pillow
pip install transformers==4.52.0
import torch
from transformers import CLIPModel, CLIPProcessor
from PIL import Image
device = "cuda" if torch.cuda.is_available() else "cpu"
model = CLIPModel.from_pretrained("kwanY/styleid").to(device)
processor = CLIPProcessor.from_pretrained("kwanY/styleid")
img = Image.open(img_path).convert("RGB")
inputs = processor(images=img, return_tensors="pt").to(device)
with torch.no_grad():
emb = model.get_image_features(**inputs)
emb = emb / emb.norm(dim=-1, keepdim=True)