Update README.md
Browse files
README.md
CHANGED
|
@@ -31,11 +31,13 @@ To use the model for inference:
|
|
| 31 |
from torchvision import transforms
|
| 32 |
import torch
|
| 33 |
from PIL import Image
|
|
|
|
| 34 |
|
| 35 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 36 |
|
| 37 |
# Load model
|
| 38 |
-
|
|
|
|
| 39 |
|
| 40 |
# Emotion label mapping
|
| 41 |
idx2label = {
|
|
|
|
| 31 |
from torchvision import transforms
|
| 32 |
import torch
|
| 33 |
from PIL import Image
|
| 34 |
+
from huggingface_hub import hf_hub_download
|
| 35 |
|
| 36 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 37 |
|
| 38 |
# Load model
|
| 39 |
+
model_path = hf_hub_download(repo_id="PerceptCLIP/PerceptCLIP_Emotions", filename="perceptCLIP_Emotions.pth")
|
| 40 |
+
model = torch.load(model_path).to(device).eval()
|
| 41 |
|
| 42 |
# Emotion label mapping
|
| 43 |
idx2label = {
|