YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
--- language: en license: apache-2.0 tags: - image-classification - computer-vision - swin-transformer - fruit-freshness - pytorch model-index: - name: Swin Transformer Fruit Freshness Model results: [] ---
Swin Transformer for Fresh vs Stale Fruit Classification
This model uses a custom-built Swin Transformer architecture trained to classify fresh vs stale fruits and vegetables.
π Classes
The model predicts one of the following 12 classes:
- fresh_apple
- fresh_banana
- fresh_bitter_gourd
- fresh_capsicum
- fresh_orange
- fresh_tomato
- stale_apple
- stale_banana
- stale_bitter_gourd
- stale_capsicum
- stale_orange
- stale_tomato
πΌοΈ Input Format
- Accepts RGB images in bytes format (e.g., from file upload).
- Automatically resized to 224x224 and normalized before inference.
π§ Model Details
- Architecture: Custom Swin Transformer
- Input size: 3 x 224 x 224
- Output: 12-class softmax
- Inference handled via
inference.py
π Usage
from inference import predict
with open("your_image.jpg", "rb") as f:
image_bytes = f.read()
prediction = predict(image_bytes)
print(prediction) # e.g., 'fresh_banana'
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support