Update README.md
Browse files
README.md
CHANGED
|
@@ -28,19 +28,16 @@ It is trained on the FER2013and AffectNet datasets, which consist of facial imag
|
|
| 28 |
## Model Details
|
| 29 |
The model has been fine-tuned using the following hyperparameters:
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
eval batch size: 64
|
| 34 |
-
|
| 35 |
-
learning rate:2e-4
|
| 36 |
-
|
| 37 |
-
gradient sccumulation steps:2
|
| 38 |
-
|
| 39 |
-
lr scheduler:'linear'
|
| 40 |
-
|
| 41 |
-
warmup ratio:0.04
|
| 42 |
-
|
| 43 |
-
num epochs:10
|
| 44 |
|
| 45 |
|
| 46 |
|
|
@@ -54,7 +51,8 @@ num epochs:10
|
|
| 54 |
## How to Get Started with the Model
|
| 55 |
Example usage:
|
| 56 |
|
| 57 |
-
'''
|
|
|
|
| 58 |
|
| 59 |
pipe = pipeline("image-classification", model="HardlyHumans/Facial-expression-detection")
|
| 60 |
|
|
@@ -67,7 +65,8 @@ outputs = model(**inputs)
|
|
| 67 |
|
| 68 |
logits = outputs.logits
|
| 69 |
predicted_class_idx = logits.argmax(-1).item()
|
| 70 |
-
predicted_label = labels[predicted_class_idx]
|
|
|
|
| 71 |
|
| 72 |
|
| 73 |
|
|
|
|
| 28 |
## Model Details
|
| 29 |
The model has been fine-tuned using the following hyperparameters:
|
| 30 |
|
| 31 |
+
| Hyperparameter | Value |
|
| 32 |
+
|-------------------------|------------|
|
| 33 |
+
| Train Batch Size | 32 |
|
| 34 |
+
| Eval Batch Size | 64 |
|
| 35 |
+
| Learning Rate | 2e-4 |
|
| 36 |
+
| Gradient Accumulation | 2 |
|
| 37 |
+
| LR Scheduler | Linear |
|
| 38 |
+
| Warmup Ratio | 0.04 |
|
| 39 |
+
| Num Epochs | 10 |
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
|
|
|
|
| 51 |
## How to Get Started with the Model
|
| 52 |
Example usage:
|
| 53 |
|
| 54 |
+
'''python
|
| 55 |
+
from transformers import AutoImageProcessor, AutoModelForImageClassification, pipeline
|
| 56 |
|
| 57 |
pipe = pipeline("image-classification", model="HardlyHumans/Facial-expression-detection")
|
| 58 |
|
|
|
|
| 65 |
|
| 66 |
logits = outputs.logits
|
| 67 |
predicted_class_idx = logits.argmax(-1).item()
|
| 68 |
+
predicted_label = labels[predicted_class_idx]
|
| 69 |
+
'''
|
| 70 |
|
| 71 |
|
| 72 |
|