Downloads · 30 days
5
2% of all-time downloads
sayfeldinn/AI-Food-Detector
AI-Food-Detector is a machine learning model from sayfeldinn. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras. The card lists the license as apache-2.0.
This is a deep learning model trained on the Food-101 dataset to classify food images into 101 categories. The model can recognize a wide range of dishes with high accuracy, making it useful for food recognition appli…
Downloads · 30 days
5
2% of all-time downloads
All-time downloads
211
Public
Repo size
82.3 MB
Likes
1
Public
Click a slice to open those files.
.keras41.3 MB · 50%
From the Hugging Face model README
This is a deep learning model trained on the Food-101 dataset to classify food images into 101 categories. The model can recognize a wide range of dishes with high accuracy, making it useful for food recognition applications in restaurants, nutrition tracking, and more. Users can input an image, and the model will predict the corresponding food category.
Dataset: Food-101
Input Size: 224x224 pixels
Normalization: Pixel values are scaled between [0, 1]
Framework: TensorFlow/Keras
Training Hardware: (Specify if trained on GPU, TPU, etc.)
model = tf.keras.models.load_model("your_model_path.h5")
def preprocess_image(image_path):
image = Image.open(image_path).resize((224, 224))
image = np.array(image) / 255.0
return np.expand_dims(image, axis=0)
image_path = "example.jpg"
image = preprocess_image(image_path)
prediction = model.predict(image)
predicted_class = class_names[np.argmax(prediction)]
print(f"Predicted Food Item: {predicted_class}")
| Image | Prediction |
|---|---|
| 🍕 | Pizza |
| 🍔 | Cheeseburger |
| 🍣 | Sushi |
| Metric | Score |
|---|---|
| Top-1 Accuracy | XX% |
| Top-5 Accuracy | XX% |
| Loss Function | Categorical Crossentropy |