Views
No views yet
| Metric | Score |
|---|---|
| Precision (p) | 99.55% |
| Recall (r) | 99.10% |
| F1-score (f1) | 99.33% |
| Epochs Trained | 15 |
| Device | CUDA (GPU) |
Epoch 15: p=0.9955 r=0.9910 f1=0.9932 time=65.3s
train/ → Training imagesval/ → Validation images1from PIL import Image
2import torch
3from torchvision import transforms
4from model import DishVerificationModel # your model class
5
6# Load model
7model = DishVerificationModel()
8model.load_state_dict(torch.load("base.pth", map_location="cpu"))
9model.eval()
10
11# Preprocess image
12transform = transforms.Compose([
13 transforms.Resize((224, 224)),
14 transforms.ToTensor()
15])
16img = Image.open("test_dish.jpg")
17img_tensor = transform(img).unsqueeze(0)
18
19# Predict
20with torch.no_grad():
21 output = model(img_tensor)
22 prediction = torch.sigmoid(output).item()
23 print("Match:", prediction > 0.5)@software{dish_verification_2025,
title = {Dish Image Verification Model},
author = {Vamsee},
year = {2025},
url = {https://huggingface.co/vamsee99/food-vs-notfood-model}
}