Downloads · 30 days
0
pandithsurya/swin-model
swin-model is a machine learning model from pandithsurya. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
<pre<code--- 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: [] --- <…
Downloads · 30 days
0
Access
Public
Updated May 27, 2025
Repo size
110 MB
Likes
0
Public
Click a slice to open those files.
.pth110 MB · 100%
From the Hugging Face model README
This model uses a custom-built Swin Transformer architecture trained to classify fresh vs stale fruits and vegetables.
The model predicts one of the following 12 classes:
inference.pyfrom 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'
## 🚀 Deployment on Hugging Face
1. Upload all files to your Hugging Face repository
2. Required files:
- `pipeline.py` (main inference logic)
- `inference.py` (prediction functions)
- `swin_model.py` (model architecture)
- `swin_state_dict.pth` (model weights)
- `requirements.txt` (dependencies)
- `app.py` (optional, for API)
## Hardware Requirements
- At least 4GB RAM
- GPU recommended but not required
## Expected File Structure