File size: 1,052 Bytes
fef7539
72d8bce
 
 
 
 
 
 
 
 
8f63c21
 
 
 
72d8bce
 
 
 
8f63c21
 
 
72d8bce
 
 
 
 
 
 
 
 
 
 
 
 
8f63c21
72d8bce
 
 
 
fef7539
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40


# EfficientNet-B0 Fruit & Vegetable Classifier 🍎πŸ₯•πŸŒ½

This model classifies images of fruits and vegetables into multiple categories.  
It is trained on the [Fruit and Vegetable Image Recognition dataset](https://www.kaggle.com/datasets/kritikseth/fruit-and-vegetable-image-recognition).

---

## πŸ“Š Dataset Statistics
- Training Images: {len(train_dataset)}
- Validation Images: {len(val_dataset)}
- Test Images: {len(test_dataset)}
- Classes: {len(class_names)} β†’ {class_names}

---

## πŸ† Results
- Final Training Accuracy: {train_acc:.2f}%
- Final Validation Accuracy: {val_acc:.2f}%
- Final Test Accuracy: {test_acc:.2f}%

---

## πŸš€ Usage
```python
import torch
from torchvision import models

# Load model
model = models.efficientnet_b0(pretrained=False)
num_features = model.classifier[1].in_features
model.classifier = torch.nn.Sequential(
    torch.nn.Dropout(0.3),
    torch.nn.Linear(num_features, {len(class_names)})
)

# Load weights
model.load_state_dict(torch.load("pytorch_model.bin", map_location="cpu"))
model.eval()