Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
# Food Detection Model
|
| 3 |
+
|
| 4 |
+
## Model Özeti
|
| 5 |
+
Bu model, gıda ve gıda dışı nesneleri sınıflandırmak için eğitilmiştir. Model, **270 farklı yemek kategorisini** algılayabilir.
|
| 6 |
+
|
| 7 |
+
## Kullanım
|
| 8 |
+
Bu modeli kullanmak için aşağıdaki kodu çalıştırabilirsiniz:
|
| 9 |
+
|
| 10 |
+
```python
|
| 11 |
+
from transformers import CLIPModel, CLIPProcessor
|
| 12 |
+
|
| 13 |
+
model = CLIPModel.from_pretrained("mertcan81/food-detection-model")
|
| 14 |
+
processor = CLIPProcessor.from_pretrained("mertcan81/food-detection-model")
|
| 15 |
+
|
| 16 |
+
# Görsel üzerinde tahmin
|
| 17 |
+
from PIL import Image
|
| 18 |
+
image = Image.open("example.jpg")
|
| 19 |
+
inputs = processor(images=image, text=["food", "non-food"], return_tensors="pt")
|
| 20 |
+
outputs = model(**inputs)
|
| 21 |
+
logits_per_image = outputs.logits_per_image
|
| 22 |
+
probs = logits_per_image.softmax(dim=1)
|
| 23 |
+
print("Tahmin:", probs)
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Veri Kümesi
|
| 27 |
+
Model, [Food-101](https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/) veri seti ile eğitilmiştir.
|
| 28 |
+
|
| 29 |
+
## Lisans
|
| 30 |
+
MIT Lisansı altında sunulmuştur.
|
| 31 |
+
|