Views
No views yet
efficientnet_b0 with a replaced classifier head.src/train.py:outputs/checkpoints/best_model.pthoutputs/checkpoints/class_to_idx.jsonabdallahalidev/plantvillage-dataset) is used for tomato/maize/pepper/corn classes.data/raw in one of these supported formats:train.csv + train_images/cbb, cbsd, cgm, cmd, healthy) or equivalent verbose names handled by alias mapping in prepare_dataset.py.src/prepare_dataset.py:abdallahalidev/plantvillage-dataset).data/raw (primary workflow).cbb, cbsd, cgm, cmd, healthy.CASSAVA_KAGGLEHUB_DATASET only if you want non-competition cassava auto-download.data/processed/traindata/processed/valdata/processed/testsrc/evaluate.py.1python -m src.evaluate \
2 --checkpoint outputs/checkpoints/best_model.pth \
3 --class-map outputs/checkpoints/class_to_idx.jsonoutputs/checkpoints/test_classification_report.txtoutputs/checkpoints/test_confusion_matrix.jsonsrc/infer.py.1python -m src.infer \
2 --image /path/to/leaf.jpg \
3 --checkpoint outputs/checkpoints/best_model.pth \
4 --class-map outputs/checkpoints/class_to_idx.json \
5 --top-k 3ml/ directory:1pip install -r requirements.txt
2# optional ONLY if you want non-competition cassava auto-download
3# export CASSAVA_KAGGLEHUB_DATASET="<owner/dataset-slug>"
4python -m src.prepare_dataset
5python -m src.train
6python -m src.evaluaterequirements.txt (huggingface_hub).1import os
2from pathlib import Path
3from huggingface_hub import HfApi
4
5repo_id = "your-hf-username/farmguard-ai-crop-disease-model"
6token = os.environ["HF_TOKEN"]
7
8api = HfApi()
9api.create_repo(repo_id=repo_id, repo_type="model", exist_ok=True, token=token)
10
11for artifact in [
12 "outputs/checkpoints/best_model.pth",
13 "outputs/checkpoints/class_to_idx.json",
14 "outputs/checkpoints/test_classification_report.txt",
15 "outputs/checkpoints/test_confusion_matrix.json",
16]:
17 p = Path(artifact)
18 if p.exists():
19 api.upload_file(
20 path_or_fileobj=str(p),
21 path_in_repo=p.name,
22 repo_id=repo_id,
23 repo_type="model",
24 token=token,
25 )train_config.yaml exists, but current training code uses hardcoded defaults in src/train.py.requirements.txt.