Instructions to use Shadyemad/s24-apple-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Shadyemad/s24-apple-detector with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("Shadyemad/s24-apple-detector") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
๐ S24 Farms Apple Detection Model
YOLOv8n ูู ูุดู ุงูุชูุงุญ ูุชูุฏูุฑ ุงูู ุญุตูู โ Apple detection and yield estimation
Usage
from ultralytics import YOLO
# Load model directly from Hugging Face Hub
model = YOLO("s24-farms/apple-detector/best.pt")
# Detect apples in image
results = model("orchard.jpg", conf=0.25, iou=0.45)
for r in results:
print(f"Detected {{len(r.boxes)}} apples")
Model Details
| Property | Value |
|---|---|
| Architecture | YOLOv8n (nano) |
| Input size | 640ร640 |
| Confidence threshold | 0.25 |
| NMS IoU | 0.45 |
| Training images | 200 synthetic + 3000 augmented |
| Classes | 1 (apple) |
Detection Pipeline
- YOLOv8n โ Primary detector (fast, ~0.2s per image on CPU)
- OpenCV Color Blob โ Fallback for red/yellow apples
- Watershed Segmentation โ Separates touching apples
- Hough Circles โ Detects round shapes with apple-like color
Features per Apple
- Bounding box with confidence score
- Estimated diameter (mm) with range (ยฑ5mm)
- Estimated weight (g) with range (ยฑ15%)
- Variety classification (Red/Golden/Granny/Mixed)
- Disease detection (Scab, Bitter Rot, Sooty Blotch, Sunburn, Powdery Mildew)
- Size classification (Small/Medium/Large)
Video Tracking (ByteTrack)
from tracker import process_video_file
result = process_video_file("orchard_row.mp4", max_frames=300)
print(f"Unique apples: {{result['summary']['total_unique_apples']}}")
Web API (FastAPI)
pip install -r requirements.txt
python api_fastapi.py 8080
# โ http://localhost:8080/docs
Dataset
The model was trained on 200 synthetic apple images (generated in Unreal Engine) and augmented to 3200 images using Albumentations:
- Random brightness/contrast (ยฑ30%)
- HSV shifts (Hยฑ20, Sยฑ30, Vยฑ20)
- Gaussian/Motion blur
- CLAHE, GaussNoise, RandomShadow
- Horizontal flip
Citation
@software{s24_farms_apple_detector,
author = {{S24 Farms}},
title = {{S24 Farms Apple Detection}},
year = {2026},
url = {https://huggingface.co/s24-farms/apple-detector}
}
- Downloads last month
- 42