YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

--- 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'
## πŸš€ 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
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support