Views
No views yet
| Hyperparameter | Value |
|---|---|
| Train Batch Size | 32 |
| Eval Batch Size | 64 |
| Learning Rate | 2e-4 |
| Gradient Accumulation | 2 |
| LR Scheduler | Linear |
| Warmup Ratio | 0.04 |
| Num Epochs | 10 |
1from transformers import AutoImageProcessor, AutoModelForImageClassification, pipeline
2
3pipe = pipeline("image-classification", model="HardlyHumans/Facial-expression-detection")
4
5processor = AutoImageProcessor.from_pretrained("HardlyHumans/Facial-expression-detection")
6model = AutoModelForImageClassification.from_pretrained("HardlyHumans/Facial-expression-detection")
7
8labels = model.config.id2label
9
10outputs = model(**inputs)
11
12logits = outputs.logits
13predicted_class_idx = logits.argmax(-1).item()
14predicted_label = labels[predicted_class_idx]