| --- |
| language: en |
| license: mit |
| tags: |
| - image-classification |
| - pytorch |
| - cnn |
| - fruit-classifier |
| pipeline_tag: image-classification |
| --- |
| |
| # π Fruit Classifier |
|
|
| Custom CNN trained from scratch in PyTorch to classify 10 fruits from images. Achieves 61.3% validation accuracy on just 230 training images. |
|
|
| ## Usage |
|
|
| ```python |
| from predict import load_model, predict |
| |
| model = load_model("fc_model_weights.pth") |
| fruit_name, confidence = predict(model, "your_image.jpg") |
| print(f"Predicted: {fruit_name} ({(100*confidence):>0.1f}%)") |
| ``` |
|
|
| ## Supported Fruits |
|
|
| Apple, Banana, Avocado, Cherry, Kiwi, Mango, Orange, Pineapple, Strawberries, Watermelon |
|
|
| ## Files |
|
|
| - `fc_model.pth` β full model for inference |
| - `fc_model_weights.pth` β weights for resuming training |
| - `fruit_benefits.json` β nutritional knowledge base |
| - `predict.py` β inference utility |
|
|
| ## Full Project |
|
|
| Training pipeline and RAG workflow available on GitHub: |
| [GitHub Repository](https://github.com/tarakaprabhuchinta/fruit-classifier) |
|
|