Update model card to English
Browse files
README.md
CHANGED
|
@@ -19,40 +19,40 @@ pipeline_tag: object-detection
|
|
| 19 |
|
| 20 |
# CropScan - Plant Disease Detection Model
|
| 21 |
|
| 22 |
-
CropScan
|
| 23 |
|
| 24 |
-
##
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
**CropScan
|
| 29 |
|
| 30 |
-
- **
|
| 31 |
-
- **
|
| 32 |
-
- **
|
| 33 |
-
- **
|
| 34 |
|
| 35 |
-
|
| 36 |
|
| 37 |
-
##
|
| 38 |
|
| 39 |
-
| Image
|
| 40 |
-
|
| 41 |
|  |  |
|
| 42 |
|
| 43 |
-
|
| 44 |
|
| 45 |
-
## Details
|
| 46 |
|
| 47 |
-
| Specification |
|
| 48 |
-
|
| 49 |
| **Architecture** | RF-DETR (medium) |
|
| 50 |
-
| **
|
| 51 |
| **Performance** | mAP@50: 0.502 |
|
| 52 |
-
| **
|
| 53 |
| **Format** | PyTorch (.pth) |
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
### Installation
|
| 58 |
|
|
@@ -67,41 +67,41 @@ import torch
|
|
| 67 |
from rfdetr import RFDETRBase
|
| 68 |
from PIL import Image
|
| 69 |
|
| 70 |
-
#
|
| 71 |
model = RFDETRBase()
|
| 72 |
checkpoint = torch.load("checkpoint_best_total.pth", map_location="cpu")
|
| 73 |
model.load_state_dict(checkpoint)
|
| 74 |
model.eval()
|
| 75 |
|
| 76 |
-
#
|
| 77 |
-
image = Image.open("
|
| 78 |
|
| 79 |
-
#
|
| 80 |
with torch.no_grad():
|
| 81 |
predictions = model(image)
|
| 82 |
|
| 83 |
-
#
|
| 84 |
```
|
| 85 |
|
| 86 |
-
### Integration
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
```python
|
| 91 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 92 |
|
| 93 |
-
#
|
| 94 |
predictor = SAM2ImagePredictor.from_pretrained("facebook/sam2-hiera-small")
|
| 95 |
predictor.set_image(image)
|
| 96 |
|
| 97 |
for box in predictions.boxes:
|
| 98 |
masks, scores, _ = predictor.predict(box=box, multimask_output=False)
|
| 99 |
-
# masks
|
| 100 |
```
|
| 101 |
|
| 102 |
-
##
|
| 103 |
|
| 104 |
-
|
| 105 |
|
| 106 |
```bibtex
|
| 107 |
@misc{plant-disease-faxnj_dataset,
|
|
@@ -117,24 +117,24 @@ Ce modele a ete entraine sur le dataset Plant Disease de Roboflow Universe, cont
|
|
| 117 |
}
|
| 118 |
```
|
| 119 |
|
| 120 |
-
##
|
| 121 |
|
| 122 |
-
- **Agriculture
|
| 123 |
-
- **
|
| 124 |
-
- **
|
| 125 |
-
- **
|
| 126 |
|
| 127 |
## Limitations
|
| 128 |
|
| 129 |
-
-
|
| 130 |
-
-
|
| 131 |
-
-
|
| 132 |
-
-
|
| 133 |
|
| 134 |
-
##
|
| 135 |
|
| 136 |
-
|
| 137 |
|
| 138 |
---
|
| 139 |
|
| 140 |
-
*
|
|
|
|
| 19 |
|
| 20 |
# CropScan - Plant Disease Detection Model
|
| 21 |
|
| 22 |
+
CropScan is a plant disease detection model based on RF-DETR, designed to help farmers quickly identify health issues in their crops.
|
| 23 |
|
| 24 |
+
## Why CropScan?
|
| 25 |
|
| 26 |
+
Farming is hard work. Farmers face countless daily challenges: unpredictable weather, economic pressures, and most critically, crop diseases that can devastate entire harvests in just a few days.
|
| 27 |
|
| 28 |
+
**CropScan was built to:**
|
| 29 |
|
| 30 |
+
- **Help farmers** detect diseases early, before they spread
|
| 31 |
+
- **Reduce crop losses** through rapid and targeted intervention
|
| 32 |
+
- **Optimize treatment usage** by precisely identifying affected areas
|
| 33 |
+
- **Democratize access** to advanced diagnostic tools, once reserved for experts
|
| 34 |
|
| 35 |
+
Whether you're a small-scale farmer or a large producer, CropScan gives you the power to protect your crops with artificial intelligence.
|
| 36 |
|
| 37 |
+
## Detection Example
|
| 38 |
|
| 39 |
+
| Original Image | Detection Result |
|
| 40 |
+
|:--------------:|:----------------:|
|
| 41 |
|  |  |
|
| 42 |
|
| 43 |
+
The left image shows a leaf with disease symptoms. The right image shows CropScan's result: each diseased region is identified and segmented with precision using SAM2 integration.
|
| 44 |
|
| 45 |
+
## Technical Details
|
| 46 |
|
| 47 |
+
| Specification | Value |
|
| 48 |
+
|--------------|-------|
|
| 49 |
| **Architecture** | RF-DETR (medium) |
|
| 50 |
+
| **Task** | Object Detection / Disease Localization |
|
| 51 |
| **Performance** | mAP@50: 0.502 |
|
| 52 |
+
| **Model Size** | 134 MB |
|
| 53 |
| **Format** | PyTorch (.pth) |
|
| 54 |
|
| 55 |
+
## Usage
|
| 56 |
|
| 57 |
### Installation
|
| 58 |
|
|
|
|
| 67 |
from rfdetr import RFDETRBase
|
| 68 |
from PIL import Image
|
| 69 |
|
| 70 |
+
# Load the model
|
| 71 |
model = RFDETRBase()
|
| 72 |
checkpoint = torch.load("checkpoint_best_total.pth", map_location="cpu")
|
| 73 |
model.load_state_dict(checkpoint)
|
| 74 |
model.eval()
|
| 75 |
|
| 76 |
+
# Load an image
|
| 77 |
+
image = Image.open("your_image.jpg")
|
| 78 |
|
| 79 |
+
# Run detection
|
| 80 |
with torch.no_grad():
|
| 81 |
predictions = model(image)
|
| 82 |
|
| 83 |
+
# predictions contains bounding boxes of diseased regions
|
| 84 |
```
|
| 85 |
|
| 86 |
+
### SAM2 Integration (Recommended)
|
| 87 |
|
| 88 |
+
For precise segmentation masks instead of bounding boxes, combine CropScan with SAM2:
|
| 89 |
|
| 90 |
```python
|
| 91 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
| 92 |
|
| 93 |
+
# Use CropScan boxes as prompts for SAM2
|
| 94 |
predictor = SAM2ImagePredictor.from_pretrained("facebook/sam2-hiera-small")
|
| 95 |
predictor.set_image(image)
|
| 96 |
|
| 97 |
for box in predictions.boxes:
|
| 98 |
masks, scores, _ = predictor.predict(box=box, multimask_output=False)
|
| 99 |
+
# masks contains the precise segmentation mask
|
| 100 |
```
|
| 101 |
|
| 102 |
+
## Training Data
|
| 103 |
|
| 104 |
+
This model was trained on the Plant Disease dataset from Roboflow Universe, containing images of leaves with various diseases.
|
| 105 |
|
| 106 |
```bibtex
|
| 107 |
@misc{plant-disease-faxnj_dataset,
|
|
|
|
| 117 |
}
|
| 118 |
```
|
| 119 |
|
| 120 |
+
## Use Cases
|
| 121 |
|
| 122 |
+
- **Precision Agriculture**: Automated crop monitoring via drone or fixed camera
|
| 123 |
+
- **Field Diagnosis**: Mobile app for rapid disease identification
|
| 124 |
+
- **Agricultural Research**: Study of plant disease propagation
|
| 125 |
+
- **Education**: Teaching tool for agronomy students
|
| 126 |
|
| 127 |
## Limitations
|
| 128 |
|
| 129 |
+
- Trained primarily on PlantVillage-style images
|
| 130 |
+
- Best performance on individual leaf images with clear backgrounds
|
| 131 |
+
- SAM2 recommended for precise segmentation masks
|
| 132 |
+
- Does not replace expert agronomist diagnosis
|
| 133 |
|
| 134 |
+
## License
|
| 135 |
|
| 136 |
+
This model is distributed under the MIT license. You are free to use, modify, and distribute it for commercial or non-commercial purposes.
|
| 137 |
|
| 138 |
---
|
| 139 |
|
| 140 |
+
*Built with passion to support those who feed us.*
|