🚀 面部表情識別模型
本模型是一個專注於面部表情識別的模型,它基於預訓練模型進行微調,在相關數據集上取得了不錯的評估結果,能有效識別多種面部表情。
🚀 快速開始
示例代碼
from transformers import AutoImageProcessor, AutoModelForImageClassification, pipeline
pipe = pipeline("image-classification", model="HardlyHumans/Facial-expression-detection")
processor = AutoImageProcessor.from_pretrained("HardlyHumans/Facial-expression-detection")
model = AutoModelForImageClassification.from_pretrained("HardlyHumans/Facial-expression-detection")
labels = model.config.id2label
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
predicted_label = labels[predicted_class_idx]
✨ 主要特性
- 該模型是在google/vit-base-patch16-224-in21k基礎上,在FER 2013和AffectNet數據集上進行微調的版本。
- 在評估集上取得了較高的準確率(0.922)和較低的損失(0.213)。
- 能夠識別八種不同的面部表情,包括憤怒、輕蔑、悲傷、快樂、中性、厭惡、恐懼和驚訝。
📦 安裝指南
暫未提及安裝相關內容。
💻 使用示例
基礎用法
from transformers import AutoImageProcessor, AutoModelForImageClassification, pipeline
pipe = pipeline("image-classification", model="HardlyHumans/Facial-expression-detection")
processor = AutoImageProcessor.from_pretrained("HardlyHumans/Facial-expression-detection")
model = AutoModelForImageClassification.from_pretrained("HardlyHumans/Facial-expression-detection")
labels = model.config.id2label
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
predicted_label = labels[predicted_class_idx]
📚 詳細文檔
模型描述
vit-face-expression模型是一個經過微調的視覺變換器模型,專門用於面部情緒識別任務。它在FER2013和AffectNet數據集上進行訓練,這些數據集包含被分類為八種不同情緒的面部圖像,分別為憤怒、輕蔑、悲傷、快樂、中性、厭惡、恐懼和驚訝。
模型細節
模型使用以下超參數進行微調:
超參數 |
值 |
訓練批次大小 |
32 |
評估批次大小 |
64 |
學習率 |
2e - 4 |
梯度累積 |
2 |
學習率調度器 |
線性 |
預熱比例 |
0.04 |
訓練輪數 |
10 |
模型架構和目標
暫未詳細說明模型架構和目標相關內容。
🔧 技術細節
暫未提供足夠的技術實現細節。
📄 許可證
本模型使用的許可證為MIT。
🌱 環境影響
使用 機器學習影響計算器 估算的淨二氧化碳排放量約為8.82千克。
模型相關信息
屬性 |
詳情 |
開發者 |
Hardly Humans club, IIT Dharwad |
模型類型 |
視覺變換器 |
許可證 |
MIT |
微調基礎模型 |
google/vit-base-patch16-224-in21k |
硬件類型 |
T4 |
使用時長 |
8 + 27小時 |
雲服務提供商 |
Google collabotary service |
計算區域 |
南亞 - 1 |
碳排放 |
8.82千克 |
參考信息
- 模型卡片元數據規範參考:https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
- 文檔/指南:https://huggingface.co/docs/hub/model-cards