Train_YOLOv11-M
In [ ]:
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
In [ ]:
!pip install numpy pillow opencv-python transformers accelerate timm einops ultralytics kornia | grep -E "Downloading|Installing|Successfully"
Downloading ultralytics-8.4.178-py3-none-any.whl.metadata (46 kB) Downloading kornia-0.8.3-py3-none-any.whl.metadata (22 kB) Downloading nvidia_ml_py-13.615.71-py3-none-any.whl.metadata (9.7 kB) Downloading ultralytics_thop-2.2.2-py3-none-any.whl.metadata (14 kB) Downloading ultralytics_platform-0.1.90-py3-none-any.whl.metadata (17 kB) Downloading kornia_rs-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB) Downloading ultralytics-8.4.178-py3-none-any.whl (1.4 MB) Downloading kornia-0.8.3-py3-none-any.whl (1.2 MB) Downloading kornia_rs-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB) Downloading nvidia_ml_py-13.615.71-py3-none-any.whl (58 kB) Downloading ultralytics_platform-0.1.90-py3-none-any.whl (97 kB) Downloading ultralytics_thop-2.2.2-py3-none-any.whl (32 kB) Installing collected packages: nvidia-ml-py, kornia-rs, ultralytics-thop, ultralytics-platform, kornia, ultralytics Successfully installed kornia-0.8.3 kornia-rs-0.2.0 nvidia-ml-py-13.615.71 ultralytics-8.4.178 ultralytics-platform-0.1.90 ultralytics-thop-2.2.2
Unique Dataset Renaming and Standardization
In [ ]:
import os
import shutil
import zipfile
from google.colab import drive
# Source directory on Drive (where the 28 zip files are located)
drive_source_dir = "/content/drive/MyDrive/AgriMultiCrop-BD"
# Local Colab directory (for faster processing)
local_processed_dir = "/content/processed_dataset"
os.makedirs(local_processed_dir, exist_ok=True)
print("🚀 Starting unzip and rename process...\n")
# Scan all files on Drive
zip_files = [f for f in os.listdir(drive_source_dir) if f.lower().endswith('.zip')]
print(f"📦 Total zip files found: {len(zip_files)}\n")
for zip_file in sorted(zip_files):
# Determine class name by stripping extension from zip file name
class_name = os.path.splitext(zip_file)[0]
zip_path = os.path.join(drive_source_dir, zip_file)
# Dedicated directory for this class in the local processed folder
target_class_dir = os.path.join(local_processed_dir, class_name)
os.makedirs(target_class_dir, exist_ok=True)
print(f"📂 Extracting and processing: {class_name}")
# Read files directly from inside the zip and write to local drive with renaming
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
for file_info in zip_ref.infolist():
# Skip directories or macOS hidden files
if file_info.is_dir() or file_info.filename.startswith('__MACOSX') or os.path.basename(file_info.filename).startswith('.'):
continue
orig_filename = os.path.basename(file_info.filename)
# Process only image files
if orig_filename.lower().endswith(('.png', '.jpg', '.jpeg')):
# Avoid duplicates if file already has the prefix attached
if orig_filename.startswith(f"{class_name}_"):
new_filename = orig_filename
else:
new_filename = f"{class_name}_{orig_filename}"
destination_path = os.path.join(target_class_dir, new_filename)
# Extract file from zip and save under the new name
with zip_ref.open(file_info) as source, open(destination_path, "wb") as target:
shutil.copyfileobj(source, target)
print("\n🎉 All files have been successfully unzipped, renamed, and saved to Colab!")
🚀 Starting unzip and rename process... 📦 Total zip files found: 28 📂 Extracting and processing: Bottle_Gourd_Flower_Blossom_Blight 📂 Extracting and processing: Bottle_Gourd_Flower_Healthy 📂 Extracting and processing: Bottle_Gourd_Fruit_Borer 📂 Extracting and processing: Bottle_Gourd_Fruit_Healthy 📂 Extracting and processing: Bottle_Gourd_Leaf_Healthy 📂 Extracting and processing: Bottle_Gourd_Leaf_Wilt 📂 Extracting and processing: Eggplant_Fruit_Borer 📂 Extracting and processing: Eggplant_Fruit_Healthy 📂 Extracting and processing: Eggplant_Leaf_Healthy 📂 Extracting and processing: Eggplant_Leaf_Mosaic_Virus 📂 Extracting and processing: Eggplant_Leaf_Wilt 📂 Extracting and processing: Okra_Leaf_Healthy 📂 Extracting and processing: Okra_Leaf_Yellow_Vein_Mosaic_Virus 📂 Extracting and processing: Papaya_Fruit_Anthracnose 📂 Extracting and processing: Papaya_Fruit_Healthy 📂 Extracting and processing: Papaya_Leaf_Curl_Virus 📂 Extracting and processing: Papaya_Leaf_Healthy 📂 Extracting and processing: Papaya_Leaf_Mosaic_Virus 📂 Extracting and processing: Papaya_Leaf_Spot 📂 Extracting and processing: Pointed_Gourd_Fruit_Healthy 📂 Extracting and processing: Pointed_Gourd_Fruit_Rot 📂 Extracting and processing: Pointed_Gourd_Leaf_Healthy 📂 Extracting and processing: Pointed_Gourd_Leaf_Potassium_Deficiency 📂 Extracting and processing: Teasel_Gourd_Fruit_Healthy 📂 Extracting and processing: Teasel_Gourd_Fruit_Rot 📂 Extracting and processing: Teasel_Gourd_Leaf_Blight 📂 Extracting and processing: Teasel_Gourd_Leaf_Healthy 📂 Extracting and processing: Teasel_Gourd_Leaf_Spot 🎉 All files have been successfully unzipped, renamed, and saved to Colab!
Exporting Standardized Renamed Dataset to Drive
In [ ]:
import os
import shutil
# Local directory of renamed files
local_processed_dir = "/content/processed_dataset"
# Drive folder where the zips will be saved
drive_output_dir = "/content/drive/MyDrive/AgriMultiCrop-BD-Renamed-Zips"
os.makedirs(drive_output_dir, exist_ok=True)
print("📦 Starting to zip folders and send them to Google Drive...\n")
folders = [f for f in os.listdir(local_processed_dir) if os.path.isdir(os.path.join(local_processed_dir, f))]
for idx, folder_name in enumerate(sorted(folders), 1):
source_folder_path = os.path.join(local_processed_dir, folder_name)
# Target zip file path for Drive (shutil automatically appends .zip)
archive_base_path = os.path.join(drive_output_dir, folder_name)
print(f"[{idx}/{len(folders)}] Zipping: {folder_name} ...")
# Convert the folder to a zip file and write to Drive
shutil.make_archive(
base_name=archive_base_path,
format='zip',
root_dir=source_folder_path
)
print(f"\n🎉 Successfully saved 28 folders as zip files to Drive!\nPath: {drive_output_dir}")
📦 Starting to zip folders and send them to Google Drive... [1/28] Zipping: Bottle_Gourd_Flower_Blossom_Blight ... [2/28] Zipping: Bottle_Gourd_Flower_Healthy ... [3/28] Zipping: Bottle_Gourd_Fruit_Borer ... [4/28] Zipping: Bottle_Gourd_Fruit_Healthy ... [5/28] Zipping: Bottle_Gourd_Leaf_Healthy ... [6/28] Zipping: Bottle_Gourd_Leaf_Wilt ... [7/28] Zipping: Eggplant_Fruit_Borer ... [8/28] Zipping: Eggplant_Fruit_Healthy ... [9/28] Zipping: Eggplant_Leaf_Healthy ... [10/28] Zipping: Eggplant_Leaf_Mosaic_Virus ... [11/28] Zipping: Eggplant_Leaf_Wilt ... [12/28] Zipping: Okra_Leaf_Healthy ... [13/28] Zipping: Okra_Leaf_Yellow_Vein_Mosaic_Virus ... [14/28] Zipping: Papaya_Fruit_Anthracnose ... [15/28] Zipping: Papaya_Fruit_Healthy ... [16/28] Zipping: Papaya_Leaf_Curl_Virus ... [17/28] Zipping: Papaya_Leaf_Healthy ... [18/28] Zipping: Papaya_Leaf_Mosaic_Virus ... [19/28] Zipping: Papaya_Leaf_Spot ... [20/28] Zipping: Pointed_Gourd_Fruit_Healthy ... [21/28] Zipping: Pointed_Gourd_Fruit_Rot ... [22/28] Zipping: Pointed_Gourd_Leaf_Healthy ... [23/28] Zipping: Pointed_Gourd_Leaf_Potassium_Deficiency ... [24/28] Zipping: Teasel_Gourd_Fruit_Healthy ... [25/28] Zipping: Teasel_Gourd_Fruit_Rot ... [26/28] Zipping: Teasel_Gourd_Leaf_Blight ... [27/28] Zipping: Teasel_Gourd_Leaf_Healthy ... [28/28] Zipping: Teasel_Gourd_Leaf_Spot ... 🎉 Successfully saved 28 folders as zip files to Drive! Path: /content/drive/MyDrive/AgriMultiCrop-BD-Renamed-Zips
Automated Mask and Label Generation via BiRefNet
In [ ]:
import os
import cv2
import torch
import zipfile
import numpy as np
from PIL import Image, ImageOps
from torchvision import transforms
from transformers import AutoModelForImageSegmentation
from tqdm import tqdm
# 1. Unzip All Zip Files from Drive Folder
zips_dir = "/content/drive/MyDrive/AgriMultiCrop-BD-Renamed-Zips"
extracted_dir = "/content/unzipped_raw_images"
if not os.path.exists(zips_dir):
raise FileNotFoundError(f"Folder not found in Drive: {zips_dir}\nPlease make sure Drive is correctly mounted.")
os.makedirs(extracted_dir, exist_ok=True)
# Find all .zip files in the folder
zip_files = [f for f in os.listdir(zips_dir) if f.lower().endswith('.zip')]
if not zip_files:
raise FileNotFoundError(f"No .zip files found in {zips_dir}")
print(f"📦 Unzipping a total of {len(zip_files)} zip files, please wait...")
for z_file in tqdm(sorted(zip_files), desc="Unzipping classes"):
full_zip_path = os.path.join(zips_dir, z_file)
# Extract the images inside each zip file into their respective named folders
class_folder_name = os.path.splitext(z_file)[0]
target_extract_path = os.path.join(extracted_dir, class_folder_name)
os.makedirs(target_extract_path, exist_ok=True)
with zipfile.ZipFile(full_zip_path, 'r') as zip_ref:
zip_ref.extractall(target_extract_path)
print("✅ All zip files have been successfully unzipped!")
# 2. Class Mapping (All 28 classes mapped from 0 to 27)
class_mapping = {
"Bottle_Gourd_Flower_Blossom_Blight": 0,
"Bottle_Gourd_Flower_Healthy": 1,
"Bottle_Gourd_Fruit_Borer": 2,
"Bottle_Gourd_Fruit_Healthy": 3,
"Bottle_Gourd_Leaf_Healthy": 4,
"Bottle_Gourd_Leaf_Wilt": 5,
"Eggplant_Fruit_Borer": 6,
"Eggplant_Fruit_Healthy": 7,
"Eggplant_Leaf_Healthy": 8,
"Eggplant_Leaf_Mosaic_Virus": 9,
"Eggplant_Leaf_Wilt": 10,
"Okra_Leaf_Healthy": 11,
"Okra_Leaf_Yellow_Vein_Mosaic_Virus": 12,
"Papaya_Fruit_Anthracnose": 13,
"Papaya_Fruit_Healthy": 14,
"Papaya_Leaf_Curl_Virus": 15,
"Papaya_Leaf_Healthy": 16,
"Papaya_Leaf_Mosaic_Virus": 17,
"Papaya_Leaf_Spot": 18,
"Pointed_Gourd_Fruit_Healthy": 19,
"Pointed_Gourd_Fruit_Rot": 20,
"Pointed_Gourd_Leaf_Healthy": 21,
"Pointed_Gourd_Leaf_Potassium_Deficiency": 22,
"Teasel_Gourd_Fruit_Healthy": 23,
"Teasel_Gourd_Fruit_Rot": 24,
"Teasel_Gourd_Leaf_Blight": 25,
"Teasel_Gourd_Leaf_Healthy": 26,
"Teasel_Gourd_Leaf_Spot": 27
}
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Device being used: {device}")
# 3. BiRefNet Model Load
model = AutoModelForImageSegmentation.from_pretrained(
"ZhengPeng7/BiRefNet",
trust_remote_code=True
).to(device)
if device == "cuda":
model = model.half()
model.eval()
transform_image = transforms.Compose([
transforms.Resize((1024, 1024)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
# 4. HSV Color Fallback for Close-Up Leaf
def recover_fullframe_leaf(cv_img_rgb):
hsv = cv2.cvtColor(cv_img_rgb, cv2.COLOR_RGB2HSV)
lower_green = np.array([15, 20, 20])
upper_green = np.array([95, 255, 255])
mask = cv2.inRange(hsv, lower_green, upper_green)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (15, 15))
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)
mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, kernel)
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
if contours:
c = max(contours, key=cv2.contourArea)
filled_mask = np.zeros_like(mask)
cv2.drawContours(filled_mask, [c], -1, 255, thickness=cv2.FILLED)
return filled_mask
return mask
# 5. Main Pipeline
def generate_ultimate_pipeline(base_img_dir, output_txt_dir, output_mask_dir):
for folder_name, class_id in class_mapping.items():
class_folder = os.path.join(base_img_dir, folder_name)
if not os.path.exists(class_folder):
print(f"Folder not found: {folder_name}, skipping...")
continue
txt_out = os.path.join(output_txt_dir, folder_name)
mask_out = os.path.join(output_mask_dir, folder_name)
os.makedirs(txt_out, exist_ok=True)
os.makedirs(mask_out, exist_ok=True)
is_leaf_class = "leaf" in folder_name.lower()
images = [f for f in os.listdir(class_folder) if f.lower().endswith(('.png', '.jpg', '.jpeg'))]
print(f"\nProcessing class {class_id}: {folder_name} (Leaf Mode: {is_leaf_class}, Total images: {len(images)})...")
for img_name in tqdm(images, desc=folder_name):
img_path = os.path.join(class_folder, img_name)
orig_img = Image.open(img_path).convert("RGB")
w, h = orig_img.size
total_pixels = w * h
if is_leaf_class:
pad_w = int(w * 0.30)
pad_h = int(h * 0.30)
process_img = ImageOps.expand(orig_img, border=(pad_w, pad_h), fill=(125, 125, 125))
pw, ph = process_img.size
else:
process_img = orig_img
pw, ph = w, h
input_tensor = transform_image(process_img).unsqueeze(0).to(device)
if device == "cuda":
input_tensor = input_tensor.half()
with torch.no_grad():
preds = model(input_tensor)[-1].sigmoid().cpu()
pred = preds.float().squeeze()
pred_mask = transforms.ToPILImage()(pred).resize((pw, ph))
if is_leaf_class:
cropped_mask = pred_mask.crop((pad_w, pad_h, pad_w + w, pad_h + h))
mask_np = np.array(cropped_mask)
else:
mask_np = np.array(pred_mask)
_, binary_mask = cv2.threshold(mask_np, 25, 255, cv2.THRESH_BINARY)
white_pixels = cv2.countNonZero(binary_mask)
if is_leaf_class and white_pixels < (total_pixels * 0.15):
binary_mask = recover_fullframe_leaf(np.array(orig_img))
base_name = os.path.splitext(img_name)[0]
cv2.imwrite(os.path.join(mask_out, f"{base_name}.png"), binary_mask)
contours, _ = cv2.findContours(binary_mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
txt_path = os.path.join(txt_out, f"{base_name}.txt")
with open(txt_path, 'w') as f:
for contour in contours:
if cv2.contourArea(contour) < 50:
continue
polygon = []
for point in contour:
x, y = point[0]
polygon.append(f"{x / w:.6f} {y / h:.6f}")
if polygon:
f.write(f"{class_id} " + " ".join(polygon) + "\n")
print("\n✅ Mask and YOLO label generation for all 28 classes completed successfully!")
# Execution
generate_ultimate_pipeline(
base_img_dir="/content/unzipped_raw_images",
output_txt_dir="/content/dataset/labels",
output_mask_dir="/content/dataset/masks"
)
📦 Unzipping a total of 28 zip files, please wait...
Unzipping classes: 100%|██████████| 28/28 [01:56<00:00, 4.16s/it]
✅ All zip files have been successfully unzipped! Device being used: cuda
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads. WARNING:huggingface_hub.utils._http:Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
[transformers] A new version of the following files was downloaded from https://huggingface.co/ZhengPeng7/BiRefNet: - BiRefNet_config.py . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
[transformers] A new version of the following files was downloaded from https://huggingface.co/ZhengPeng7/BiRefNet: - birefnet.py . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Processing class 0: Bottle_Gourd_Flower_Blossom_Blight (Leaf Mode: False, Total images: 63)...
Bottle_Gourd_Flower_Blossom_Blight: 100%|██████████| 63/63 [00:33<00:00, 1.87it/s]
Processing class 1: Bottle_Gourd_Flower_Healthy (Leaf Mode: False, Total images: 75)...
Bottle_Gourd_Flower_Healthy: 100%|██████████| 75/75 [00:39<00:00, 1.92it/s]
Processing class 2: Bottle_Gourd_Fruit_Borer (Leaf Mode: False, Total images: 87)...
Bottle_Gourd_Fruit_Borer: 100%|██████████| 87/87 [00:44<00:00, 1.95it/s]
Processing class 3: Bottle_Gourd_Fruit_Healthy (Leaf Mode: False, Total images: 88)...
Bottle_Gourd_Fruit_Healthy: 100%|██████████| 88/88 [00:50<00:00, 1.74it/s]
Processing class 4: Bottle_Gourd_Leaf_Healthy (Leaf Mode: True, Total images: 99)...
Bottle_Gourd_Leaf_Healthy: 100%|██████████| 99/99 [01:43<00:00, 1.05s/it]
Processing class 5: Bottle_Gourd_Leaf_Wilt (Leaf Mode: True, Total images: 85)...
Bottle_Gourd_Leaf_Wilt: 100%|██████████| 85/85 [00:56<00:00, 1.51it/s]
Processing class 6: Eggplant_Fruit_Borer (Leaf Mode: False, Total images: 62)...
Eggplant_Fruit_Borer: 100%|██████████| 62/62 [00:38<00:00, 1.61it/s]
Processing class 7: Eggplant_Fruit_Healthy (Leaf Mode: False, Total images: 104)...
Eggplant_Fruit_Healthy: 100%|██████████| 104/104 [01:21<00:00, 1.28it/s]
Processing class 8: Eggplant_Leaf_Healthy (Leaf Mode: True, Total images: 222)...
Eggplant_Leaf_Healthy: 100%|██████████| 222/222 [07:21<00:00, 1.99s/it]
Processing class 9: Eggplant_Leaf_Mosaic_Virus (Leaf Mode: True, Total images: 106)...
Eggplant_Leaf_Mosaic_Virus: 100%|██████████| 106/106 [01:37<00:00, 1.09it/s]
Processing class 10: Eggplant_Leaf_Wilt (Leaf Mode: True, Total images: 72)...
Eggplant_Leaf_Wilt: 100%|██████████| 72/72 [00:42<00:00, 1.70it/s]
Processing class 11: Okra_Leaf_Healthy (Leaf Mode: True, Total images: 81)...
Okra_Leaf_Healthy: 100%|██████████| 81/81 [01:22<00:00, 1.01s/it]
Processing class 12: Okra_Leaf_Yellow_Vein_Mosaic_Virus (Leaf Mode: True, Total images: 89)...
Okra_Leaf_Yellow_Vein_Mosaic_Virus: 100%|██████████| 89/89 [02:03<00:00, 1.39s/it]
Processing class 13: Papaya_Fruit_Anthracnose (Leaf Mode: False, Total images: 89)...
Papaya_Fruit_Anthracnose: 100%|██████████| 89/89 [01:12<00:00, 1.22it/s]
Processing class 14: Papaya_Fruit_Healthy (Leaf Mode: False, Total images: 87)...
Papaya_Fruit_Healthy: 100%|██████████| 87/87 [01:29<00:00, 1.03s/it]
Processing class 15: Papaya_Leaf_Curl_Virus (Leaf Mode: True, Total images: 90)...
Papaya_Leaf_Curl_Virus: 100%|██████████| 90/90 [01:41<00:00, 1.13s/it]
Processing class 16: Papaya_Leaf_Healthy (Leaf Mode: True, Total images: 120)...
Papaya_Leaf_Healthy: 100%|██████████| 120/120 [01:27<00:00, 1.38it/s]
Processing class 17: Papaya_Leaf_Mosaic_Virus (Leaf Mode: True, Total images: 65)...
Papaya_Leaf_Mosaic_Virus: 100%|██████████| 65/65 [01:02<00:00, 1.04it/s]
Processing class 18: Papaya_Leaf_Spot (Leaf Mode: True, Total images: 106)...
Papaya_Leaf_Spot: 100%|██████████| 106/106 [01:47<00:00, 1.02s/it]
Processing class 19: Pointed_Gourd_Fruit_Healthy (Leaf Mode: False, Total images: 78)...
Pointed_Gourd_Fruit_Healthy: 100%|██████████| 78/78 [00:43<00:00, 1.81it/s]
Processing class 20: Pointed_Gourd_Fruit_Rot (Leaf Mode: False, Total images: 52)...
Pointed_Gourd_Fruit_Rot: 100%|██████████| 52/52 [00:28<00:00, 1.84it/s]
Processing class 21: Pointed_Gourd_Leaf_Healthy (Leaf Mode: True, Total images: 115)...
Pointed_Gourd_Leaf_Healthy: 100%|██████████| 115/115 [01:41<00:00, 1.13it/s]
Processing class 22: Pointed_Gourd_Leaf_Potassium_Deficiency (Leaf Mode: True, Total images: 83)...
Pointed_Gourd_Leaf_Potassium_Deficiency: 100%|██████████| 83/83 [01:40<00:00, 1.21s/it]
Processing class 23: Teasel_Gourd_Fruit_Healthy (Leaf Mode: False, Total images: 134)...
Teasel_Gourd_Fruit_Healthy: 100%|██████████| 134/134 [01:40<00:00, 1.33it/s]
Processing class 24: Teasel_Gourd_Fruit_Rot (Leaf Mode: False, Total images: 121)...
Teasel_Gourd_Fruit_Rot: 100%|██████████| 121/121 [01:08<00:00, 1.76it/s]
Processing class 25: Teasel_Gourd_Leaf_Blight (Leaf Mode: True, Total images: 61)...
Teasel_Gourd_Leaf_Blight: 100%|██████████| 61/61 [00:38<00:00, 1.58it/s]
Processing class 26: Teasel_Gourd_Leaf_Healthy (Leaf Mode: True, Total images: 151)...
Teasel_Gourd_Leaf_Healthy: 100%|██████████| 151/151 [02:10<00:00, 1.16it/s]
Processing class 27: Teasel_Gourd_Leaf_Spot (Leaf Mode: True, Total images: 62)...
Teasel_Gourd_Leaf_Spot: 100%|██████████| 62/62 [00:54<00:00, 1.15it/s]
✅ Mask and YOLO label generation for all 28 classes completed successfully!
Exporting Generated Masks and Labels to Drive
In [ ]:
import shutil
import os
source_dir = "/content/dataset"
# shutil automatically appends .zip at the end, so the name is given without extension
output_base_path = "/content/drive/MyDrive/masked-28"
print("📦 Zipping '/content/dataset' to Google Drive as 'masked-28.zip'...")
shutil.make_archive(
base_name=output_base_path,
format='zip',
root_dir=source_dir
)
print("🎉 Successfully saved: /content/drive/MyDrive/masked-28.zip")
📦 Zipping '/content/dataset' to Google Drive as 'masked-28.zip'... 🎉 Successfully saved: /content/drive/MyDrive/masked-28.zip
Segmentation Overlay and Mask Preview
In [ ]:
import os
import random
import matplotlib.pyplot as plt
import cv2
output_dir = "/content/yolo_dataset"
train_img_dir = os.path.join(output_dir, "train", "images")
train_mask_dir = os.path.join(output_dir, "train", "masks")
train_lbl_dir = os.path.join(output_dir, "train", "labels")
# Get some random images from the training set
all_images = [f for f in os.listdir(train_img_dir) if f.lower().endswith((".jpg", ".jpeg", ".png"))]
if len(all_images) > 0:
# Select up to 3 random sample images to visualize
sample_images = random.sample(all_images, min(3, len(all_images)))
plt.figure(figsize=(15, 5))
for i, img_name in enumerate(sample_images):
base_name, _ = os.path.splitext(img_name)
img_path = os.path.join(train_img_dir, img_name)
mask_path = os.path.join(train_mask_dir, base_name + ".png")
# Read image and mask using OpenCV
img = cv2.imread(img_path)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
mask = cv2.imread(mask_path, cv2.IMREAD_GRAYSCALE) if os.path.exists(mask_path) else None
# Plot Original Image
plt.subplot(2, len(sample_images), i + 1)
plt.imshow(img)
plt.title(f"Image: {img_name[:15]}...")
plt.axis('off')
# Plot Corresponding Mask
plt.subplot(2, len(sample_images), len(sample_images) + i + 1)
if mask is not None:
plt.imshow(mask, cmap='gray')
plt.title(f"Mask: {base_name[:15]}...")
else:
plt.title("Mask Missing!")
plt.axis('off')
plt.tight_layout()
plt.show()
else:
print("No images found in train/images folder yet! Please run the split script first.")
In [ ]:
import os
import matplotlib.pyplot as plt
from PIL import Image
mask_base_dir = "/content/dataset/masks"
# List of 28 classes
classes = [
"Bottle_Gourd_Flower_Blossom_Blight",
"Bottle_Gourd_Flower_Healthy",
"Bottle_Gourd_Fruit_Borer",
"Bottle_Gourd_Fruit_Healthy",
"Bottle_Gourd_Leaf_Healthy",
"Bottle_Gourd_Leaf_Wilt",
"Eggplant_Fruit_Borer",
"Eggplant_Fruit_Healthy",
"Eggplant_Leaf_Healthy",
"Eggplant_Leaf_Mosaic_Virus",
"Eggplant_Leaf_Wilt",
"Okra_Leaf_Healthy",
"Okra_Leaf_Yellow_Vein_Mosaic_Virus",
"Papaya_Fruit_Anthracnose",
"Papaya_Fruit_Healthy",
"Papaya_Leaf_Curl_Virus",
"Papaya_Leaf_Healthy",
"Papaya_Leaf_Mosaic_Virus",
"Papaya_Leaf_Spot",
"Pointed_Gourd_Fruit_Healthy",
"Pointed_Gourd_Fruit_Rot",
"Pointed_Gourd_Leaf_Healthy",
"Pointed_Gourd_Leaf_Potassium_Deficiency",
"Teasel_Gourd_Fruit_Healthy",
"Teasel_Gourd_Fruit_Rot",
"Teasel_Gourd_Leaf_Blight",
"Teasel_Gourd_Leaf_Healthy",
"Teasel_Gourd_Leaf_Spot"
]
num_rows = 7 # 7 rows
num_cols = 4 # 4 columns (4 × 7 = 28 classes)
# Figure size set for clear and medium-scale visualization
fig, axes = plt.subplots(num_rows, num_cols, figsize=(20, 28))
axes = axes.flatten()
for idx, class_name in enumerate(classes):
ax = axes[idx]
class_folder = os.path.join(mask_base_dir, class_name)
# Display the first mask image from the folder
if os.path.exists(class_folder):
images = [f for f in sorted(os.listdir(class_folder)) if f.lower().endswith(('.png', '.jpg', '.jpeg'))]
if images:
img_path = os.path.join(class_folder, images[0])
img = Image.open(img_path)
ax.imshow(img, cmap='gray')
ax.set_title(class_name, fontsize=10, fontweight='bold', pad=8)
else:
ax.text(0.5, 0.5, "No Images", ha='center', va='center', fontsize=9)
ax.set_title(class_name, fontsize=10, fontweight='bold', pad=8)
else:
ax.text(0.5, 0.5, "Folder Not Found", ha='center', va='center', fontsize=9)
ax.set_title(class_name, fontsize=10, fontweight='bold', pad=8)
ax.axis('off')
plt.tight_layout(pad=3.0)
plt.show()
Data Ingestion and Baseline Quantity Verification (N = 2,630)
In [ ]:
import os
base_img_dir = "/content/dataset/masks"
image_extensions = ('.jpg', '.jpeg', '.png')
if os.path.exists(base_img_dir):
print(f"{'Class Name':<45} | {'Image Count'}")
print("-" * 60)
total_images = 0
# Get sorted list of all class folders
classes = sorted([d for d in os.listdir(base_img_dir) if os.path.isdir(os.path.join(base_img_dir, d))])
for class_name in classes:
class_dir = os.path.join(base_img_dir, class_name)
# Count valid image files in the specific class folder
images = [f for f in os.listdir(class_dir) if f.lower().endswith(image_extensions)]
count = len(images)
total_images += count
print(f"{class_name:<45} | {count}")
print("-" * 60)
print(f"Total Classes: {len(classes)} | Total Images: {total_images}")
else:
print(f"Error: The directory '{base_img_dir}' does not exist!")
Class Name | Image Count ------------------------------------------------------------ Bottle_Gourd_Flower_Blossom_Blight | 62 Bottle_Gourd_Flower_Healthy | 71 Bottle_Gourd_Fruit_Borer | 87 Bottle_Gourd_Fruit_Healthy | 88 Bottle_Gourd_Leaf_Healthy | 99 Bottle_Gourd_Leaf_Wilt | 85 Eggplant_Fruit_Borer | 62 Eggplant_Fruit_Healthy | 104 Eggplant_Leaf_Healthy | 222 Eggplant_Leaf_Mosaic_Virus | 104 Eggplant_Leaf_Wilt | 72 Okra_Leaf_Healthy | 77 Okra_Leaf_Yellow_Vein_Mosaic_Virus | 88 Papaya_Fruit_Anthracnose | 89 Papaya_Fruit_Healthy | 87 Papaya_Leaf_Curl_Virus | 90 Papaya_Leaf_Healthy | 120 Papaya_Leaf_Mosaic_Virus | 65 Papaya_Leaf_Spot | 106 Pointed_Gourd_Fruit_Healthy | 78 Pointed_Gourd_Fruit_Rot | 52 Pointed_Gourd_Leaf_Healthy | 113 Pointed_Gourd_Leaf_Potassium_Deficiency | 83 Teasel_Gourd_Fruit_Healthy | 134 Teasel_Gourd_Fruit_Rot | 120 Teasel_Gourd_Leaf_Blight | 61 Teasel_Gourd_Leaf_Healthy | 149 Teasel_Gourd_Leaf_Spot | 62 ------------------------------------------------------------ Total Classes: 28 | Total Images: 2630
Quality Filtering & File Alignment Verification (Raw Images, Masks, and Labels) (N = 2,570)
In [ ]:
import os
import shutil
import zipfile
from google.colab import drive
from tqdm import tqdm
# 1. Mount Google Drive
drive.mount('/content/drive')
# 2. Provide the correct path for your folder and zip file in Drive
# (Match these two paths according to your actual Drive structure)
drive_raw_images_folder = "/content/drive/MyDrive/AgriMultiCrop-BD-Unzipped_Yolov11_train_Cleaned" # Unzipped folder containing 28 classes
drive_zip_path = "/content/drive/MyDrive/masked-28_updated_Cleaned.zip" # Zip file containing labels and masks
# Colab fast local directories
local_images_dir = "/content/local_dataset/images"
local_labels_dir = "/content/local_dataset/labels"
local_masks_dir = "/content/local_dataset/masks"
temp_extract_dir = "/content/temp_extracted"
os.makedirs(local_images_dir, exist_ok=True)
os.makedirs(local_labels_dir, exist_ok=True)
os.makedirs(local_masks_dir, exist_ok=True)
# 3. Copy original images from Drive to Colab local storage
print("📥 Copying original images from Drive to Colab...")
if not os.path.exists(drive_raw_images_folder):
raise FileNotFoundError(f"Path not found: {drive_raw_images_folder}")
for class_name in tqdm(os.listdir(drive_raw_images_folder), desc="Copying Original Images"):
src_class_path = os.path.join(drive_raw_images_folder, class_name)
if os.path.isdir(src_class_path):
dst_class_path = os.path.join(local_images_dir, class_name)
os.makedirs(dst_class_path, exist_ok=True)
for img_file in os.listdir(src_class_path):
if img_file.lower().endswith(('.png', '.jpg', '.jpeg')):
src_file = os.path.join(src_class_path, img_file)
dst_file = os.path.join(dst_class_path, img_file)
if not os.path.exists(dst_file):
shutil.copy2(src_file, dst_file)
print("✅ Original images successfully copied to Colab!")
# 4. Unzip file and arrange labels and masks into local directories
print("\n📦 Unzipping file from Drive...")
if not os.path.exists(drive_zip_path):
raise FileNotFoundError(f"Zip file not found: {drive_zip_path}")
os.makedirs(temp_extract_dir, exist_ok=True)
with zipfile.ZipFile(drive_zip_path, 'r') as zip_ref:
zip_ref.extractall(temp_extract_dir)
# Find 'labels' and 'masks' folders inside the zip
found_labels_path = None
found_masks_path = None
for root, dirs, files in os.walk(temp_extract_dir):
for d in dirs:
if d.lower() in ['label', 'labels']:
found_labels_path = os.path.join(root, d)
elif d.lower() in ['mask', 'masks']:
found_masks_path = os.path.join(root, d)
if not found_labels_path or not found_masks_path:
raise FileNotFoundError("Could not find 'labels' or 'masks' folder inside the zip file!")
# Move to local directories
print("📂 Organizing Labels and Masks...")
shutil.copytree(found_labels_path, local_labels_dir, dirs_exist_ok=True)
shutil.copytree(found_masks_path, local_masks_dir, dirs_exist_ok=True)
shutil.rmtree(temp_extract_dir) # Delete temporary folder
print("✅ Labels and Masks successfully loaded into Colab!")
# 5. 1:1 Pairing and sync verification in Colab local folder
class_names = [
"Bottle_Gourd_Flower_Blossom_Blight", "Bottle_Gourd_Flower_Healthy",
"Bottle_Gourd_Fruit_Borer", "Bottle_Gourd_Fruit_Healthy",
"Bottle_Gourd_Leaf_Healthy", "Bottle_Gourd_Leaf_Wilt",
"Eggplant_Fruit_Borer", "Eggplant_Fruit_Healthy",
"Eggplant_Leaf_Healthy", "Eggplant_Leaf_Mosaic_Virus", "Eggplant_Leaf_Wilt",
"Okra_Leaf_Healthy", "Okra_Leaf_Yellow_Vein_Mosaic_Virus",
"Papaya_Fruit_Anthracnose", "Papaya_Fruit_Healthy",
"Papaya_Leaf_Curl_Virus", "Papaya_Leaf_Healthy", "Papaya_Leaf_Mosaic_Virus", "Papaya_Leaf_Spot",
"Pointed_Gourd_Fruit_Healthy", "Pointed_Gourd_Fruit_Rot",
"Pointed_Gourd_Leaf_Healthy", "Pointed_Gourd_Leaf_Potassium_Deficiency",
"Teasel_Gourd_Fruit_Healthy", "Teasel_Gourd_Fruit_Rot",
"Teasel_Gourd_Leaf_Blight", "Teasel_Gourd_Leaf_Healthy", "Teasel_Gourd_Leaf_Spot"
]
print("\n🔍 Verifying dataset integrity and 1:1 pairing...\n")
total_valid_pairs = 0
has_mismatch = False
for c_name in class_names:
img_dir = os.path.join(local_images_dir, c_name)
lbl_dir = os.path.join(local_labels_dir, c_name)
msk_dir = os.path.join(local_masks_dir, c_name)
if not (os.path.exists(img_dir) and os.path.exists(lbl_dir) and os.path.exists(msk_dir)):
print(f"⚠️ Missing folder: {c_name}")
has_mismatch = True
continue
img_stems = {os.path.splitext(f)[0] for f in os.listdir(img_dir) if f.lower().endswith(('.png', '.jpg', '.jpeg'))}
lbl_stems = {os.path.splitext(f)[0] for f in os.listdir(lbl_dir) if f.lower().endswith('.txt')}
msk_stems = {os.path.splitext(f)[0] for f in os.listdir(msk_dir) if f.lower().endswith('.png')}
missing_in_labels = img_stems - lbl_stems
missing_in_masks = img_stems - msk_stems
orphan_labels = lbl_stems - img_stems
orphan_masks = msk_stems - img_stems
matched_stems = img_stems.intersection(lbl_stems).intersection(msk_stems)
total_valid_pairs += len(matched_stems)
class_has_issue = False
if missing_in_labels or missing_in_masks or orphan_labels or orphan_masks:
has_mismatch = True
class_has_issue = True
print(f"❌ Mismatch found: [{c_name}]")
if missing_in_labels:
print(f" ↳ Missing label (.txt) for image ({len(missing_in_labels)})")
if missing_in_masks:
print(f" ↳ Missing mask (.png) for image ({len(missing_in_masks)})")
if orphan_labels:
print(f" ↳ Extra orphan labels ({len(orphan_labels)})")
if orphan_masks:
print(f" ↳ Extra orphan masks ({len(orphan_masks)})")
if not class_has_issue:
print(f"✅ {c_name:<40} : {len(matched_stems)} files completely synced")
print("\n" + "="*50)
if not has_mismatch:
print(f"🎉 All files loaded and synced into Colab perfectly!")
print(f"Total training-ready samples: {total_valid_pairs}")
else:
print("⚠️ Inconsistencies found in some files. Please check the log above.")
print("="*50)
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
📥 Copying original images from Drive to Colab...
Copying Original Images: 100%|██████████| 28/28 [08:40<00:00, 18.59s/it]
✅ Original images successfully copied to Colab! 📦 Unzipping file from Drive... 📂 Organizing Labels and Masks... ✅ Labels and Masks successfully loaded into Colab! 🔍 Verifying dataset integrity and 1:1 pairing... ✅ Bottle_Gourd_Flower_Blossom_Blight : 63 files completely synced ✅ Bottle_Gourd_Flower_Healthy : 75 files completely synced ✅ Bottle_Gourd_Fruit_Borer : 87 files completely synced ✅ Bottle_Gourd_Fruit_Healthy : 88 files completely synced ✅ Bottle_Gourd_Leaf_Healthy : 91 files completely synced ✅ Bottle_Gourd_Leaf_Wilt : 84 files completely synced ✅ Eggplant_Fruit_Borer : 62 files completely synced ✅ Eggplant_Fruit_Healthy : 104 files completely synced ✅ Eggplant_Leaf_Healthy : 220 files completely synced ✅ Eggplant_Leaf_Mosaic_Virus : 101 files completely synced ✅ Eggplant_Leaf_Wilt : 71 files completely synced ✅ Okra_Leaf_Healthy : 79 files completely synced ✅ Okra_Leaf_Yellow_Vein_Mosaic_Virus : 89 files completely synced ✅ Papaya_Fruit_Anthracnose : 88 files completely synced ✅ Papaya_Fruit_Healthy : 86 files completely synced ✅ Papaya_Leaf_Curl_Virus : 79 files completely synced ✅ Papaya_Leaf_Healthy : 120 files completely synced ✅ Papaya_Leaf_Mosaic_Virus : 62 files completely synced ✅ Papaya_Leaf_Spot : 105 files completely synced ✅ Pointed_Gourd_Fruit_Healthy : 78 files completely synced ✅ Pointed_Gourd_Fruit_Rot : 52 files completely synced ✅ Pointed_Gourd_Leaf_Healthy : 105 files completely synced ✅ Pointed_Gourd_Leaf_Potassium_Deficiency : 83 files completely synced ✅ Teasel_Gourd_Fruit_Healthy : 134 files completely synced ✅ Teasel_Gourd_Fruit_Rot : 121 files completely synced ✅ Teasel_Gourd_Leaf_Blight : 59 files completely synced ✅ Teasel_Gourd_Leaf_Healthy : 133 files completely synced ✅ Teasel_Gourd_Leaf_Spot : 51 files completely synced ================================================== 🎉 All files loaded and synced into Colab perfectly! Total training-ready samples: 2570 ==================================================
In [ ]:
!pip install -q ultralytics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.9/46.9 kB 2.7 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 25.4 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.1/58.1 kB 4.9 MB/s eta 0:00:00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.6/97.6 kB 7.4 MB/s eta 0:00:00
Train-Validation Data Splitting (80% Train, 20% Val) & YOLO11m Model Training
In [ ]:
import os
import shutil
import random
import yaml
from ultralytics import YOLO
# 1. Directory Setup for YOLO Format
base_data_dir = "/content/yolo_detection_dataset"
train_img_dir = os.path.join(base_data_dir, "images/train")
val_img_dir = os.path.join(base_data_dir, "images/val")
train_lbl_dir = os.path.join(base_data_dir, "labels/train")
val_lbl_dir = os.path.join(base_data_dir, "labels/val")
for d in [train_img_dir, val_img_dir, train_lbl_dir, val_lbl_dir]:
os.makedirs(d, exist_ok=True)
local_images_dir = "/content/local_dataset/images"
local_labels_dir = "/content/local_dataset/labels"
# 28 Classes List
class_names = [
"Bottle_Gourd_Flower_Blossom_Blight", "Bottle_Gourd_Flower_Healthy",
"Bottle_Gourd_Fruit_Borer", "Bottle_Gourd_Fruit_Healthy",
"Bottle_Gourd_Leaf_Healthy", "Bottle_Gourd_Leaf_Wilt",
"Eggplant_Fruit_Borer", "Eggplant_Fruit_Healthy",
"Eggplant_Leaf_Healthy", "Eggplant_Leaf_Mosaic_Virus", "Eggplant_Leaf_Wilt",
"Okra_Leaf_Healthy", "Okra_Leaf_Yellow_Vein_Mosaic_Virus",
"Papaya_Fruit_Anthracnose", "Papaya_Fruit_Healthy",
"Papaya_Leaf_Curl_Virus", "Papaya_Leaf_Healthy", "Papaya_Leaf_Mosaic_Virus", "Papaya_Leaf_Spot",
"Pointed_Gourd_Fruit_Healthy", "Pointed_Gourd_Fruit_Rot",
"Pointed_Gourd_Leaf_Healthy", "Pointed_Gourd_Leaf_Potassium_Deficiency",
"Teasel_Gourd_Fruit_Healthy", "Teasel_Gourd_Fruit_Rot",
"Teasel_Gourd_Leaf_Blight", "Teasel_Gourd_Leaf_Healthy", "Teasel_Gourd_Leaf_Spot"
]
# 2. Stratified Train-Val Split (80% Train, 20% Val)
random.seed(42)
split_ratio = 0.8
print("📂 Splitting dataset into Train and Validation sets...")
for c_name in class_names:
img_class_path = os.path.join(local_images_dir, c_name)
lbl_class_path = os.path.join(local_labels_dir, c_name)
if not os.path.exists(img_class_path) or not os.path.exists(lbl_class_path):
continue
# Collect only matched files
img_files = sorted([f for f in os.listdir(img_class_path) if f.lower().endswith(('.png', '.jpg', '.jpeg'))])
matched_stems = []
for f in img_files:
stem = os.path.splitext(f)[0]
if os.path.exists(os.path.join(lbl_class_path, f"{stem}.txt")):
matched_stems.append((f, f"{stem}.txt"))
random.shuffle(matched_stems)
split_idx = int(len(matched_stems) * split_ratio)
train_pairs = matched_stems[:split_idx]
val_pairs = matched_stems[split_idx:]
# Copy train files
for img_f, lbl_f in train_pairs:
shutil.copy2(os.path.join(img_class_path, img_f), os.path.join(train_img_dir, img_f))
shutil.copy2(os.path.join(lbl_class_path, lbl_f), os.path.join(train_lbl_dir, lbl_f))
# Copy val files
for img_f, lbl_f in val_pairs:
shutil.copy2(os.path.join(img_class_path, img_f), os.path.join(val_img_dir, img_f))
shutil.copy2(os.path.join(lbl_class_path, lbl_f), os.path.join(val_lbl_dir, lbl_f))
print(f"✅ Splitting complete! Train: {len(os.listdir(train_img_dir))} images, Val: {len(os.listdir(val_img_dir))} images.")
# 3. Create data.yaml
yaml_content = {
'path': base_data_dir,
'train': 'images/train',
'val': 'images/val',
'nc': len(class_names),
'names': class_names
}
yaml_file_path = os.path.join(base_data_dir, "data.yaml")
with open(yaml_file_path, 'w') as f:
yaml.dump(yaml_content, f, default_flow_style=False)
print(f"✅ data.yaml file created at: {yaml_file_path}")
# 4. YOLOv11 Detection Model Training
# Using pretrained detection weights (Detection, not Segmentation)
model = YOLO("yolo11m.pt")
print("\n🚀 Starting training...")
results = model.train(
data=yaml_file_path,
epochs=60, # 50-60 epochs is sufficient for BBox detection
imgsz=640, # 1024 is recommended for aspect ratio & fine details
batch=16, # 8 or 16 depending on GPU VRAM
device=0, # Colab GPU
pretrained=True,
patience=12, # Early stopping
cos_lr=True, # Smooth learning rate decay
close_mosaic=10, # Disable mosaic in last 10 epochs to stabilize fine bounding boxes
val=True,
save=True,
save_period=5,
plots=True,
name="crop_disease_yolo11m_bbox_640"
)
print("\n🎉 Training Successfully Completed!")
print("Best weights saved at: runs/detect/crop_disease_yolo11m_bbox/weights/best.pt")
📂 Splitting dataset into Train and Validation sets... ✅ Splitting complete! Train: 2045 images, Val: 525 images. ✅ data.yaml file created at: /content/yolo_detection_dataset/data.yaml 🚀 Starting training... Ultralytics 8.4.172 🚀 Python-3.13.15 torch-2.11.0+cu130 CUDA:0 (Tesla T4, 14913MiB) engine/trainer: agnostic_nms=False, amp=True, angle=1.0, augment=False, auto_augment=randaugment, batch=16, bgr=0.0, box=7.5, cache=False, cfg=None, channels_last=None, classes=None, close_mosaic=10, cls=0.5, cls_pw=0.0, cls_remap=True, compile=False, conf=None, copy_paste=0.0, copy_paste_mode=flip, cos_lr=True, cutmix=0.0, data=/content/yolo_detection_dataset/data.yaml, degrees=0.0, deterministic=True, device=0, dfl=1.5, dgrad=0.5, dis=6.0, distill_model=None, dlam=1.0, dlog=1.0, dnn=False, dropout=0.0, dynamic=False, embed=None, epochs=60, erasing=0.4, exist_ok=False, fliplr=0.5, flipud=0.0, format=torchscript, fraction=1.0, freeze=None, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, imgsz=640, iou=0.7, kobj=1.0, line_width=None, lr0=0.01, lrf=0.01, mask_ratio=4, max_det=300, mixup=0.0, mode=train, model=yolo11m.pt, momentum=0.937, mosaic=1.0, multi_scale=0.0, name=crop_disease_yolo11m_bbox_640, nbs=64, nms=None, opset=None, optimize=False, optimizer=auto, overlap_mask=True, patience=12, perspective=0.0, plots=True, pose=12.0, pretrained=True, profile=False, project=None, quantize=None, rect=False, resume=False, retina_masks=False, rle=1.0, save=True, save_conf=False, save_crop=False, save_dir=/content/runs/detect/crop_disease_yolo11m_bbox_640, save_frames=False, save_json=False, save_period=5, save_txt=False, scale=0.5, seed=0, shear=0.0, show=False, show_boxes=True, show_conf=True, show_labels=True, simplify=True, single_cls=False, source=None, split=val, stream_buffer=False, task=detect, time=None, tracker=tracktrack.yaml, translate=0.1, val=True, verbose=True, vid_stride=1, visualize=False, warmup_bias_lr=0.1, warmup_epochs=3.0, warmup_momentum=0.8, weight_decay=0.0005, workers=8, workspace=None Overriding model.yaml nc=80 with nc=28 from n params module arguments 0 -1 1 1856 ultralytics.nn.modules.conv.Conv [3, 64, 3, 2] 1 -1 1 73984 ultralytics.nn.modules.conv.Conv [64, 128, 3, 2] 2 -1 1 111872 ultralytics.nn.modules.block.C3k2 [128, 256, 1, True, 0.25] 3 -1 1 590336 ultralytics.nn.modules.conv.Conv [256, 256, 3, 2] 4 -1 1 444928 ultralytics.nn.modules.block.C3k2 [256, 512, 1, True, 0.25] 5 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] 6 -1 1 1380352 ultralytics.nn.modules.block.C3k2 [512, 512, 1, True] 7 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] 8 -1 1 1380352 ultralytics.nn.modules.block.C3k2 [512, 512, 1, True] 9 -1 1 656896 ultralytics.nn.modules.block.SPPF [512, 512, 5] 10 -1 1 990976 ultralytics.nn.modules.block.C2PSA [512, 512, 1] 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] 13 -1 1 1642496 ultralytics.nn.modules.block.C3k2 [1024, 512, 1, True] 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] 16 -1 1 542720 ultralytics.nn.modules.block.C3k2 [1024, 256, 1, True] 17 -1 1 590336 ultralytics.nn.modules.conv.Conv [256, 256, 3, 2] 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] 19 -1 1 1511424 ultralytics.nn.modules.block.C3k2 [768, 512, 1, True] 20 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] 22 -1 1 1642496 ultralytics.nn.modules.block.C3k2 [1024, 512, 1, True] 23 [16, 19, 22] 1 1432612 ultralytics.nn.modules.head.Detect [28, 16, None, [256, 512, 512]] YOLO11m summary: 231 layers, 20,074,596 parameters, 20,074,580 gradients, 68.4 GFLOPs Transferred 643/649 items from pretrained weights Freezing layer 'model.23.dfl.conv.weight' AMP: running Automatic Mixed Precision (AMP) checks... AMP: checks passed ✅ train: Fast image access ✅ (ping: 0.0±0.0 ms, read: 1780.9±1560.3 MB/s, size: 1759.6 KB) train: Scanning /content/yolo_detection_dataset/labels/train... 2045 images, 1 backgrounds, 0 corrupt: 100% ━━━━━━━━━━━━ 2045/2045 9.5it/s 3:35 train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_046.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_056.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_057.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_058.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_059.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_061.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_062.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_008.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_012.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_017.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_018.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_020.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_031.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_032.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_033.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_037.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Fruit_Healthy_BG_Fruit_Healthy_086.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Fruit_Healthy_BG_Fruit_Healthy_087.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Fruit_Healthy_BG_Fruit_Healthy_088.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_001.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_002.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_003.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_006.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_007.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_010.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_014.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_016.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_017.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_018.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_019.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_021.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_022.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_024.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_026.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_027.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_029.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_030.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_032.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_033.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_034.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_035.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_039.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_040.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_042.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_043.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_044.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_046.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_048.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_050.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_051.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_055.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_056.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_058.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_060.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_061.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_063.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_064.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_065.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_066.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_068.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_069.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_070.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_073.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_077.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_078.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_080.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_084.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_085.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_086.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_087.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_091.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_093.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_095.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_096.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_097.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_098.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_099.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_001.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_003.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_007.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_009.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_013.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_014.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_015.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_016.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_017.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_018.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_020.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_021.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_022.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_023.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_024.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_025.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_027.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_028.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_030.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_034.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_035.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_036.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_038.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_039.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_041.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_042.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_044.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_046.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_047.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_048.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_049.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_050.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_051.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_055.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_056.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_057.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_058.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_059.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_060.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_062.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_063.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_065.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_067.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_068.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_069.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_070.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_071.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_072.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_073.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_074.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_075.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_076.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_077.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_081.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_083.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_084.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_086.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_088.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_089.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_090.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_091.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_092.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_093.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_094.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_095.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_096.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_097.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_098.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_099.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_100.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_101.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_102.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Fruit_Healthy_103.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_001.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_002.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_003.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_004.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_005.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_006.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_009.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_010.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_011.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_012.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_014.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_015.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_016.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_017.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_018.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_019.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_020.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_021.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_023.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_024.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_025.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_026.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_027.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_028.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_029.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_031.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_032.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_033.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_035.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_037.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_039.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_040.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_041.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_042.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_043.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_046.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_050.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_051.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_055.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_057.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_059.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_060.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_061.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_062.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_063.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_064.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_065.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_066.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_067.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_069.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_070.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_072.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_073.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_074.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_075.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_076.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_077.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_078.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_079.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_080.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_081.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_082.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_083.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_084.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_086.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_087.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_089.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_090.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_091.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_092.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_093.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_094.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_095.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_096.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_097.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_098.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_100.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_103.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_104.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_106.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_107.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_108.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_109.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_110.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_112.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_114.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_115.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_116.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_117.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_119.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_122.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_123.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_124.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_125.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_127.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_128.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_129.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_130.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_131.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_132.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_133.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_134.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_135.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_136.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_137.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_140.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_142.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_143.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_144.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_145.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_147.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_148.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_149.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_151.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_152.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_154.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_155.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_157.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_158.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_159.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_160.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_162.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_163.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_164.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_165.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_167.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_168.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_169.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_170.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_172.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_174.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_176.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_177.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_178.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_179.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_180.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_181.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_183.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_188.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_189.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_194.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_195.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_196.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_198.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_199.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_200.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_211.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_212.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_213.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_214.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_218.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_219.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Healthy_221.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Eggplant_Leaf_Mosaic_Virus_Eggplant_Leaf_Mosaic_099.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_001.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_002.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_003.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_004.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_005.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_006.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_007.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_008.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_009.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_010.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_011.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_012.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_013.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_014.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_017.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_018.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_021.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_022.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_023.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_024.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_026.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_027.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_028.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_029.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_030.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_031.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_033.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_034.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_036.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_037.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_039.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_040.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_041.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_042.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_043.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_044.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_046.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_048.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_051.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_057.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_058.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_059.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_060.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_065.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_067.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_069.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_070.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_071.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_072.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_073.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_074.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_075.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_076.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_077.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_078.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_079.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_080.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Okra_Leaf_Healthy_081.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Papaya_Leaf_Mosaic_Virus_Papaya_Leaf_Mosaic_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Papaya_Leaf_Mosaic_Virus_Papaya_Leaf_Mosaic_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_027.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_028.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_030.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_031.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_032.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_033.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_034.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_036.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_037.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_039.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_040.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_042.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_044.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_045.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_050.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_051.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_052.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_053.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_054.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_055.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_056.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_057.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_059.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_060.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_061.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_062.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_064.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_066.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_067.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_068.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_070.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_072.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_073.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_076.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_077.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_078.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_079.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_081.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_082.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_085.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_090.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_093.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_094.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_095.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_096.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_097.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_098.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_099.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_101.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_102.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_104.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_105.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_107.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_108.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_109.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_111.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_113.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_114.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Teasel_Gourd_Fruit_Rot_TG_Fruit_Rot_071.jpg: corrupt JPEG restored and saved train: /content/yolo_detection_dataset/images/train/Teasel_Gourd_Fruit_Rot_TG_Fruit_Rot_073.jpg: corrupt JPEG restored and saved train: New cache created: /content/yolo_detection_dataset/labels/train.cache albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8)) val: Fast image access ✅ (ping: 0.0±0.0 ms, read: 180.3±40.4 MB/s, size: 4658.0 KB) val: Scanning /content/yolo_detection_dataset/labels/val... 525 images, 0 backgrounds, 0 corrupt: 100% ━━━━━━━━━━━━ 525/525 9.7it/s 54.2s val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_009.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_055.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_060.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_011.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_013.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_014.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_021.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_038.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_008.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_012.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_013.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_015.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_020.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_025.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_028.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_059.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_071.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_072.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_079.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_081.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_092.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_094.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_006.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_010.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_012.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_019.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_026.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_031.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_032.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_037.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_040.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_043.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_061.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_066.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_079.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_080.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_082.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_085.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_087.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Fruit_Healthy_104.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_007.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_008.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_013.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_022.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_034.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_036.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_044.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_048.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_056.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_058.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_068.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_071.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_085.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_088.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_099.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_101.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_102.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_105.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_111.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_113.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_118.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_120.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_121.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_138.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_139.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_141.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_146.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_153.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_156.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_166.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_171.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_173.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_175.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_182.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_190.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_193.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_206.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_207.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_215.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Eggplant_Leaf_Healthy_216.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_015.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_016.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_019.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_020.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_025.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_032.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_035.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_050.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_056.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_061.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_062.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_063.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_064.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_066.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Okra_Leaf_Healthy_068.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Papaya_Leaf_Spot_101.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_035.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_041.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_043.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_063.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_069.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_075.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_080.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_083.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_086.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_087.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_088.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_110.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_112.jpg: corrupt JPEG restored and saved val: /content/yolo_detection_dataset/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_115.jpg: corrupt JPEG restored and saved val: New cache created: /content/yolo_detection_dataset/labels/val.cache optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and determining best 'optimizer' and 'lr0' automatically... optimizer: AdamW(lr=0.000313, momentum=0.9) with parameter groups 106 weight(decay=0.0), 113 weight(decay=0.0005), 112 bias(decay=0.0) Plotting labels to /content/runs/detect/crop_disease_yolo11m_bbox_640/labels.jpg... Using 2045 train, 525 val images for fraction=1.0 at imgsz=640 Using 2 dataloader workers Logging results to /content/runs/detect/crop_disease_yolo11m_bbox_640 Starting training for 60 epochs... Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 1/60 10.3G 0.4763 2.282 1.17 41 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:56 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 4.8s/it 1:22 all 525 525 0.678 0.752 0.798 0.658 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 2/60 8.57G 0.5137 1.191 1.175 37 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.0s all 525 525 0.759 0.804 0.859 0.663 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 3/60 8.65G 0.5823 1.119 1.205 42 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:48 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.3s all 525 525 0.741 0.603 0.717 0.516 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 4/60 8.64G 0.6001 1.059 1.215 40 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:54 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 53.8s all 525 525 0.802 0.797 0.862 0.655 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 5/60 8.65G 0.5673 1.006 1.196 41 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:43 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.4s all 525 525 0.85 0.873 0.922 0.715 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 6/60 8.65G 0.5565 0.9582 1.187 37 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:44 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.6s all 525 525 0.834 0.872 0.925 0.744 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 7/60 8.64G 0.5309 0.8758 1.173 39 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 54.5s all 525 525 0.823 0.821 0.874 0.683 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 8/60 8.62G 0.5227 0.892 1.165 42 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:57 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.0s all 525 525 0.82 0.859 0.918 0.71 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 9/60 8.64G 0.5034 0.8064 1.155 43 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:47 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.3s all 525 525 0.867 0.897 0.945 0.752 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 10/60 8.63G 0.4995 0.8296 1.15 46 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:47 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.5s all 525 525 0.832 0.857 0.904 0.72 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 11/60 8.64G 0.4834 0.7829 1.145 45 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:51 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.3s all 525 525 0.894 0.904 0.941 0.776 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 12/60 8.63G 0.4753 0.7586 1.148 40 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:44 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.6s/it 1:01 all 525 525 0.893 0.912 0.953 0.781 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 13/60 8.62G 0.459 0.708 1.13 40 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.9s all 525 525 0.892 0.928 0.949 0.785 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 14/60 8.62G 0.4402 0.6952 1.117 41 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.3s all 525 525 0.906 0.931 0.957 0.794 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 15/60 8.62G 0.4558 0.6808 1.13 45 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:54 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.4s all 525 525 0.899 0.902 0.939 0.787 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 16/60 8.62G 0.4407 0.65 1.119 42 640: 100% ━━━━━━━━━━━━ 128/128 2.4s/it 5:04 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 54.9s all 525 525 0.898 0.888 0.954 0.805 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 17/60 8.62G 0.4232 0.6626 1.105 39 640: 100% ━━━━━━━━━━━━ 128/128 2.4s/it 5:02 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.6s/it 1:01 all 525 525 0.938 0.93 0.966 0.82 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 18/60 8.62G 0.4381 0.6253 1.116 44 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:53 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.3s all 525 525 0.898 0.946 0.968 0.823 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 19/60 8.62G 0.4248 0.6099 1.112 42 640: 100% ━━━━━━━━━━━━ 128/128 2.4s/it 5:06 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.0s all 525 525 0.869 0.907 0.949 0.804 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 20/60 8.62G 0.3932 0.5843 1.086 45 640: 100% ━━━━━━━━━━━━ 128/128 2.4s/it 5:04 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.7s all 525 525 0.921 0.922 0.964 0.813 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 21/60 8.62G 0.3975 0.5894 1.09 41 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:55 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.3s all 525 525 0.928 0.936 0.961 0.828 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 22/60 8.62G 0.3889 0.5599 1.088 43 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:48 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.0s all 525 525 0.891 0.945 0.969 0.769 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 23/60 8.62G 0.3788 0.5494 1.076 40 640: 100% ━━━━━━━━━━━━ 128/128 2.4s/it 5:01 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.1s all 525 525 0.952 0.945 0.97 0.837 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 24/60 8.62G 0.3757 0.5395 1.079 41 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:50 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.2s all 525 525 0.935 0.932 0.969 0.834 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 25/60 8.62G 0.369 0.5217 1.073 39 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:49 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.5s all 525 525 0.928 0.95 0.965 0.847 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 26/60 8.62G 0.3518 0.5122 1.06 41 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:49 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.9s all 525 525 0.91 0.959 0.971 0.855 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 27/60 8.62G 0.356 0.4944 1.068 44 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:44 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 58.8s all 525 525 0.937 0.938 0.967 0.862 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 28/60 8.62G 0.334 0.4944 1.05 38 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:47 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.4s all 525 525 0.944 0.955 0.968 0.854 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 29/60 8.62G 0.3427 0.4817 1.057 37 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:48 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.0s/it 51.2s all 525 525 0.941 0.932 0.97 0.856 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 30/60 8.62G 0.3321 0.4644 1.048 40 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:42 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.6s all 525 525 0.94 0.953 0.972 0.858 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 31/60 8.62G 0.3335 0.461 1.054 38 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:45 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.2s all 525 525 0.945 0.944 0.973 0.872 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 32/60 8.62G 0.3243 0.4569 1.05 44 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.4s all 525 525 0.951 0.944 0.974 0.861 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 33/60 8.02G 0.3113 0.4409 1.034 41 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:48 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 4.6s/it 1:19 all 525 525 0.957 0.962 0.974 0.871 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 34/60 8.06G 0.3162 0.4203 1.045 37 640: 100% ━━━━━━━━━━━━ 128/128 2.3s/it 4:52 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.3s all 525 525 0.951 0.952 0.971 0.875 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 35/60 8.05G 0.3009 0.3937 1.031 42 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:39 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.2s all 525 525 0.94 0.947 0.965 0.868 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 36/60 8.04G 0.287 0.3862 1.019 40 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:41 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.0s/it 50.2s all 525 525 0.941 0.942 0.966 0.872 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 37/60 8.04G 0.2812 0.3856 1.018 41 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:42 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 1:00 all 525 525 0.94 0.96 0.972 0.885 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 38/60 8.06G 0.2747 0.3618 1.009 37 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:44 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.6s all 525 525 0.956 0.955 0.977 0.876 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 39/60 8.04G 0.264 0.3618 1.007 39 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:40 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.0s all 525 525 0.956 0.948 0.968 0.875 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 40/60 8.06G 0.2606 0.3501 1.001 42 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:43 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.9s all 525 525 0.955 0.946 0.965 0.875 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 41/60 8.04G 0.2492 0.3358 0.9926 43 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:37 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 54.7s all 525 525 0.959 0.954 0.974 0.884 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 42/60 8.06G 0.2493 0.3429 0.9938 46 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:35 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.0s all 525 525 0.949 0.947 0.965 0.877 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 43/60 8.05G 0.252 0.3392 0.9985 45 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:43 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 2.9s/it 50.1s all 525 525 0.959 0.959 0.971 0.875 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 44/60 8.04G 0.2409 0.3242 0.9942 40 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:33 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.7s all 525 525 0.961 0.962 0.971 0.876 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 45/60 8.06G 0.2362 0.3084 0.9893 40 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:41 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.6s all 525 525 0.958 0.954 0.965 0.879 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 46/60 8.04G 0.2256 0.294 0.9791 41 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:40 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 54.6s all 525 525 0.953 0.962 0.968 0.884 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 47/60 8.06G 0.2278 0.2966 0.9833 45 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:34 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.0s/it 51.3s all 525 525 0.957 0.952 0.958 0.883 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 48/60 8.04G 0.2163 0.2827 0.9726 42 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:39 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.0s/it 51.3s all 525 525 0.961 0.946 0.967 0.886 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 49/60 8.06G 0.2211 0.29 0.9765 39 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:39 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.6s all 525 525 0.949 0.948 0.967 0.885 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 50/60 8.04G 0.2183 0.2809 0.9738 44 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:35 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.5s all 525 525 0.965 0.951 0.972 0.89 Closing dataloader mosaic albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8)) Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 51/60 8.06G 0.2018 0.2217 0.9914 13 640: 100% ━━━━━━━━━━━━ 128/128 2.2s/it 4:45 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.0s all 525 525 0.952 0.954 0.965 0.88 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 52/60 8.04G 0.1816 0.1769 0.9812 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:29 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.5s all 525 525 0.957 0.957 0.967 0.884 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 53/60 8.06G 0.177 0.1699 0.9739 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:26 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 53.1s all 525 525 0.963 0.949 0.964 0.884 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 54/60 8.04G 0.1748 0.1627 0.9688 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:29 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 56.2s all 525 525 0.959 0.956 0.965 0.885 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 55/60 8.06G 0.1717 0.1665 0.971 13 640: 100% ━━━━━━━━━━━━ 128/128 2.0s/it 4:21 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 57.8s all 525 525 0.954 0.953 0.967 0.887 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 56/60 8.04G 0.1678 0.1606 0.9536 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:26 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.1s/it 52.2s all 525 525 0.96 0.951 0.967 0.887 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 57/60 8.06G 0.1627 0.1554 0.9572 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:32 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.2s/it 54.1s all 525 525 0.959 0.951 0.968 0.89 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 58/60 8.04G 0.1637 0.1535 0.9579 13 640: 100% ━━━━━━━━━━━━ 128/128 2.0s/it 4:19 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.5s/it 59.5s all 525 525 0.959 0.95 0.968 0.891 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 59/60 8.06G 0.1629 0.1516 0.9602 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:23 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.6s/it 1:01 all 525 525 0.952 0.958 0.968 0.892 Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size 60/60 8.04G 0.1619 0.1466 0.9494 13 640: 100% ━━━━━━━━━━━━ 128/128 2.1s/it 4:28 Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.3s/it 55.8s all 525 525 0.956 0.955 0.971 0.893 28 epochs completed in 2.615 hours. Optimizer stripped from /content/runs/detect/crop_disease_yolo11m_bbox_640/weights/last.pt, 40.5MB Optimizer stripped from /content/runs/detect/crop_disease_yolo11m_bbox_640/weights/best.pt, 40.5MB Validating /content/runs/detect/crop_disease_yolo11m_bbox_640/weights/best.pt... Ultralytics 8.4.173 🚀 Python-3.13.15 torch-2.11.0+cu130 CUDA:0 (Tesla T4, 14913MiB) YOLO11m summary (fused): 125 layers, 20,051,620 parameters, 0 gradients, 67.9 GFLOPs Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 17/17 3.4s/it 58.5s all 525 525 0.955 0.955 0.971 0.893 Bottle_Gourd_Flower_Blossom_Blight 13 13 0.916 0.846 0.916 0.853 Bottle_Gourd_Flower_Healthy 15 15 0.824 0.934 0.976 0.931 Bottle_Gourd_Fruit_Borer 18 18 1 0.916 0.995 0.96 Bottle_Gourd_Fruit_Healthy 18 18 0.93 1 0.995 0.956 Bottle_Gourd_Leaf_Healthy 19 19 0.986 1 0.995 0.933 Bottle_Gourd_Leaf_Wilt 17 17 0.992 1 0.995 0.8 Eggplant_Fruit_Borer 13 13 0.982 0.923 0.925 0.886 Eggplant_Fruit_Healthy 21 21 0.944 1 0.952 0.945 Eggplant_Leaf_Healthy 44 44 0.999 1 0.995 0.877 Eggplant_Leaf_Mosaic_Virus 21 21 0.942 0.952 0.981 0.905 Eggplant_Leaf_Wilt 15 15 0.984 1 0.995 0.902 Okra_Leaf_Healthy 16 16 0.924 0.938 0.988 0.874 Okra_Leaf_Yellow_Vein_Mosaic_Virus 18 18 0.987 1 0.995 0.943 Papaya_Fruit_Anthracnose 18 18 1 0.953 0.995 0.899 Papaya_Fruit_Healthy 18 18 0.935 1 0.989 0.793 Papaya_Leaf_Curl_Virus 16 16 0.879 0.905 0.908 0.877 Papaya_Leaf_Healthy 24 24 0.934 1 0.967 0.954 Papaya_Leaf_Mosaic_Virus 13 13 1 0.643 0.939 0.831 Papaya_Leaf_Spot 21 21 0.867 1 0.976 0.972 Pointed_Gourd_Fruit_Healthy 16 16 0.987 1 0.995 0.928 Pointed_Gourd_Fruit_Rot 11 11 0.802 0.818 0.791 0.736 Pointed_Gourd_Leaf_Healthy 21 21 0.996 0.952 0.975 0.91 Pointed_Gourd_Leaf_Potassium_Deficiency 17 17 1 0.991 0.995 0.892 Teasel_Gourd_Fruit_Healthy 27 27 0.989 1 0.995 0.995 Teasel_Gourd_Fruit_Rot 25 25 1 0.983 0.995 0.889 Teasel_Gourd_Leaf_Blight 12 12 1 0.994 0.995 0.958 Teasel_Gourd_Leaf_Healthy 27 27 0.96 1 0.961 0.848 Teasel_Gourd_Leaf_Spot 11 11 0.987 1 0.995 0.762 Speed: 0.5ms preprocess, 18.3ms inference, 0.0ms loss, 1.8ms postprocess per image Results saved to /content/runs/detect/crop_disease_yolo11m_bbox_640 🎉 Training Successfully Resumed and Completed! Updated weights saved at: runs/detect/.../weights/best.pt
Exporting Model Checkpoints, Weights, and Performance Metrics
In [ ]:
import os
import shutil
from google.colab import drive
# 2. Create backup folder in Drive
backup_dir = "/content/drive/MyDrive/YOLO11_Thesis_Project"
os.makedirs(backup_dir, exist_ok=True)
print("1/2: Zipping the complete runs directory...")
# Zipping runs folder and sending to Drive (preserves all graphs, preview images, and files intact)
zip_path = os.path.join(backup_dir, "runs_detect_backup")
shutil.make_archive(zip_path, 'zip', '/content/runs/detect')
print(f"✅ Zip backup completed: {zip_path}.zip")
# 3. Copy best.pt and last.pt directly as a folder to Drive for easy access
source_weights = "/content/runs/detect/crop_disease_yolo11m_bbox_640/weights"
target_weights = os.path.join(backup_dir, "weights")
if os.path.exists(source_weights):
print("2/2: Copying best and last model weights to Drive...")
if os.path.exists(target_weights):
shutil.rmtree(target_weights)
shutil.copytree(source_weights, target_weights)
print(f"✅ Model weights saved: {target_weights}")
print("\n🎉 Congratulations! Your model, graphs, and complete results have been safely saved to Google Drive.")
1/2: Zipping the complete runs directory... ✅ Zip backup completed: /content/drive/MyDrive/YOLO11_Thesis_Project/runs_detect_backup.zip 2/2: Copying best and last model weights to Drive... ✅ Model weights saved: /content/drive/MyDrive/YOLO11_Thesis_Project/weights 🎉 Congratulations! Your model, graphs, and complete results have been safely saved to Google Drive.
In [ ]:
import os
import shutil
from google.colab import drive
# 1. Mount Google Drive (if not already mounted)
if not os.path.exists('/content/drive/MyDrive'):
drive.mount('/content/drive')
# 2. Set backup path in Drive
backup_dir = "/content/drive/MyDrive/YOLO11_Thesis_Projects_Ratul"
os.makedirs(backup_dir, exist_ok=True)
# 3. Zip the entire 'runs' folder directly
print("📦 Zipping the entire /content/runs folder to Google Drive...")
zip_target = os.path.join(backup_dir, "full_runs_backup")
shutil.make_archive(
base_name=zip_target,
format='zip',
root_dir='/content/runs'
)
print(f"🎉 Completed! Entire runs folder saved to: {zip_target}.zip")
📦 Zipping the entire /content/runs folder to Google Drive... 🎉 Completed! Entire runs folder saved to: /content/drive/MyDrive/YOLO11_Thesis_Projects_Ratul/full_runs_backup.zip
In [ ]:
!pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 | grep -E "Downloading|Installing|Successfully"
!pip install numpy pillow opencv-python transformers accelerate timm einops ultralytics kornia | grep -E "Downloading|Installing|Successfully"
Downloading ultralytics-8.4.178-py3-none-any.whl.metadata (46 kB) Downloading kornia-0.8.3-py3-none-any.whl.metadata (22 kB) Downloading nvidia_ml_py-13.615.71-py3-none-any.whl.metadata (9.7 kB) Downloading ultralytics_thop-2.2.2-py3-none-any.whl.metadata (14 kB) Downloading ultralytics_platform-0.1.90-py3-none-any.whl.metadata (17 kB) Downloading kornia_rs-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB) Downloading ultralytics-8.4.178-py3-none-any.whl (1.4 MB) Downloading kornia-0.8.3-py3-none-any.whl (1.2 MB) Downloading kornia_rs-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.3 MB) Downloading nvidia_ml_py-13.615.71-py3-none-any.whl (58 kB) Downloading ultralytics_platform-0.1.90-py3-none-any.whl (97 kB) Downloading ultralytics_thop-2.2.2-py3-none-any.whl (32 kB) Installing collected packages: nvidia-ml-py, kornia-rs, ultralytics-thop, ultralytics-platform, kornia, ultralytics Successfully installed kornia-0.8.3 kornia-rs-0.2.0 nvidia-ml-py-13.615.71 ultralytics-8.4.178 ultralytics-platform-0.1.90 ultralytics-thop-2.2.2
Performance Testing, and Model Evaluation
In [ ]:
import os
import shutil
import zipfile
import random
import yaml
from pathlib import Path
from google.colab import drive
from ultralytics import YOLO
# 1. Mount Drive
if not os.path.exists('/content/drive/MyDrive'):
drive.mount('/content/drive')
# ============================================================
# 2. Provide the 3 main Drive paths here
# ============================================================
MAIN_IMAGE_DIR = "/content/drive/MyDrive/Final Thesis File/AgriMultiCrop-BD-Unzipped_Yolov11_train_Cleaned" # Where the images are located across 28 class folders
LABELS_ZIP_PATH = "/content/drive/MyDrive/Final Thesis File/masked-28_updated_Cleaned.zip" # Path to the zip file containing label text files
BEST_MODEL_PATH = "/content/drive/MyDrive/Final Thesis File/YOLO11_Thesis_Project_33to60/weights/best.pt" # Saved best.pt
UNZIPPED_LABELS_DIR = "/content/extracted_labels/masked-28_updated_Cleaned/labels"
LOCAL_SPLIT_DIR = "/content/dataset_split"
# 3. Unzip the label zip file
if os.path.exists(UNZIPPED_LABELS_DIR):
shutil.rmtree(UNZIPPED_LABELS_DIR)
os.makedirs(UNZIPPED_LABELS_DIR, exist_ok=True)
print("📦 Unzipping label zip file...")
with zipfile.ZipFile(LABELS_ZIP_PATH, 'r') as zip_ref:
zip_ref.extractall(UNZIPPED_LABELS_DIR)
print("✅ Labels unzipped successfully!")
# 4. Create a dictionary map to quickly locate all unzipped .txt files
print("🔍 Indexing label files...")
label_map = {}
for root, _, files in os.walk(UNZIPPED_LABELS_DIR):
for f in files:
if f.endswith('.txt'):
stem = Path(f).stem
label_map[stem] = os.path.join(root, f)
print(f"✅ Total text labels found: {len(label_map)}")
# 5. Prepare split directories
if os.path.exists(LOCAL_SPLIT_DIR):
shutil.rmtree(LOCAL_SPLIT_DIR)
for split in ['train', 'val']:
os.makedirs(f"{LOCAL_SPLIT_DIR}/images/{split}", exist_ok=True)
os.makedirs(f"{LOCAL_SPLIT_DIR}/labels/{split}", exist_ok=True)
# 6. Stratified 80/20 split across 28 classes
random.seed(42)
supported_exts = ('.jpg', '.jpeg', '.png', '.bmp', '.webp', '.JPG', '.PNG', '.JPEG')
class_folders = sorted([
d for d in os.listdir(MAIN_IMAGE_DIR)
if os.path.isdir(os.path.join(MAIN_IMAGE_DIR, d)) and not d.startswith('.')
])
print(f"📁 Total detected class folders: {len(class_folders)}\nStarting split...")
total_train = 0
total_val = 0
for cls_name in class_folders:
cls_path = os.path.join(MAIN_IMAGE_DIR, cls_name)
all_files = os.listdir(cls_path)
paired_items = []
for f in all_files:
if f.endswith(supported_exts):
stem = Path(f).stem
if stem in label_map:
img_path = os.path.join(cls_path, f)
txt_path = label_map[stem]
paired_items.append((img_path, txt_path))
random.shuffle(paired_items)
split_point = int(len(paired_items) * 0.8)
train_pairs = paired_items[:split_point]
val_pairs = paired_items[split_point:]
total_train += len(train_pairs)
total_val += len(val_pairs)
for img_p, txt_p in train_pairs:
shutil.copy2(img_p, f"{LOCAL_SPLIT_DIR}/images/train/{os.path.basename(img_p)}")
shutil.copy2(txt_p, f"{LOCAL_SPLIT_DIR}/labels/train/{os.path.basename(txt_p)}")
for img_p, txt_p in val_pairs:
shutil.copy2(img_p, f"{LOCAL_SPLIT_DIR}/images/val/{os.path.basename(img_p)}")
shutil.copy2(txt_p, f"{LOCAL_SPLIT_DIR}/labels/val/{os.path.basename(txt_p)}")
print("="*45)
print(f"✅ Dataset preparation completed!")
print(f"📦 Train Images: {total_train}")
print(f"🧪 Val/Test Images: {total_val}")
print("="*45)
# 7. Generate data.yaml configuration
yaml_config = {
'path': LOCAL_SPLIT_DIR,
'train': 'images/train',
'val': 'images/val',
'names': {i: name for i, name in enumerate(class_folders)}
}
yaml_file_path = f"{LOCAL_SPLIT_DIR}/data.yaml"
with open(yaml_file_path, 'w') as f:
yaml.dump(yaml_config, f, sort_keys=False)
# 8. Run test directly using best.pt from Drive
print("\n🚀 Starting test evaluation with the best model...")
model = YOLO(BEST_MODEL_PATH)
metrics = model.val(
data=yaml_file_path,
split='val',
imgsz=640,
batch=16,
device=0,
plots=True,
name="final_test_evaluation"
)
# 9. Output metrics
print("\n" + "="*45)
print("📊 Final Test Evaluation Results:")
print(f"Precision (P) : {metrics.box.mp:.4f}")
print(f"Recall (R) : {metrics.box.mr:.4f}")
print(f"mAP@50 : {metrics.box.map50:.4f}")
print(f"mAP@50-95 : {metrics.box.map:.4f}")
print("="*45)
print("📁 All confusion matrices and curves are saved to: runs/detect/final_test_evaluation")
📦 Unzipping label zip file... ✅ Labels unzipped successfully! 🔍 Indexing label files... ✅ Total text labels found: 2570 📁 Total detected class folders: 28 Starting split... ============================================= ✅ Dataset preparation completed! 📦 Train Images: 2045 🧪 Val/Test Images: 525 ============================================= 🚀 Starting test evaluation with the best model... Ultralytics 8.4.173 🚀 Python-3.13.15 torch-2.11.0+cu130 CUDA:0 (Tesla T4, 14913MiB) YOLO11m summary (fused): 125 layers, 20,051,620 parameters, 0 gradients, 67.9 GFLOPs val: Fast image access ✅ (ping: 0.0±0.0 ms, read: 1951.9±1408.3 MB/s, size: 1897.7 KB) val: Scanning /content/dataset_split/labels/val... 525 images, 0 backgrounds, 0 corrupt: 100% ━━━━━━━━━━━━ 525/525 10.2it/s 51.3s val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_052.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_053.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_056.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Blossom_Blight_BG_Flower_Blossom_058.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_011.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Flower_Healthy_BG_Flower_Healthy_038.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Fruit_Healthy_BG_Fruit_Healthy_086.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_003.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_017.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_019.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_029.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_046.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_059.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_070.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_081.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_086.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_087.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_092.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Bottle_Gourd_Leaf_Healthy_BG_Leaf_Healthy_097.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_003.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_006.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_027.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_032.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_035.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_042.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_043.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_046.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_053.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_057.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_059.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_060.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_062.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_066.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_072.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_076.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_084.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_085.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_088.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_094.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Fruit_Healthy_104.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_002.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_004.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_014.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_022.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_028.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_032.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_037.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_052.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_054.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_069.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_073.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_075.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_082.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_100.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_102.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_103.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_104.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_108.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_113.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_114.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_122.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_128.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_129.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_132.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_141.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_143.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_148.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_154.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_155.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_168.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_177.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_178.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_188.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_198.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_199.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_206.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Eggplant_Leaf_Healthy_215.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_002.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_006.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_007.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_011.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_017.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_020.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_021.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_023.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_024.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_025.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_027.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_046.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_047.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_056.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_066.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Okra_Leaf_Healthy_071.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_037.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_038.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_041.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_044.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_049.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_053.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_054.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_061.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_062.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_068.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_072.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_076.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_083.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_090.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_099.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_110.jpg: corrupt JPEG restored and saved val: /content/dataset_split/images/val/Pointed_Gourd_Leaf_Healthy_PG_Leaf_Healthy_114.jpg: corrupt JPEG restored and saved val: New cache created: /content/dataset_split/labels/val.cache Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 33/33 1.9s/it 1:03 all 525 525 0.987 0.986 0.99 0.955 Bottle_Gourd_Flower_Blossom_Blight 13 13 0.993 1 0.995 0.971 Bottle_Gourd_Flower_Healthy 15 15 1 0.999 0.995 0.975 Bottle_Gourd_Fruit_Borer 18 18 0.992 1 0.995 0.986 Bottle_Gourd_Fruit_Healthy 18 18 0.992 1 0.995 0.99 Bottle_Gourd_Leaf_Healthy 19 19 0.991 1 0.995 0.952 Bottle_Gourd_Leaf_Wilt 17 17 0.992 1 0.995 0.962 Eggplant_Fruit_Borer 13 13 0.993 0.923 0.925 0.891 Eggplant_Fruit_Healthy 21 21 0.953 1 0.956 0.95 Eggplant_Leaf_Healthy 44 44 1 0.987 0.995 0.952 Eggplant_Leaf_Mosaic_Virus 21 21 0.946 0.952 0.987 0.96 Eggplant_Leaf_Wilt 15 15 0.995 1 0.995 0.967 Okra_Leaf_Healthy 16 16 0.992 1 0.995 0.929 Okra_Leaf_Yellow_Vein_Mosaic_Virus 18 18 0.992 1 0.995 0.956 Papaya_Fruit_Anthracnose 18 18 1 0.998 0.995 0.96 Papaya_Fruit_Healthy 18 18 0.996 1 0.995 0.954 Papaya_Leaf_Curl_Virus 16 16 0.933 1 0.995 0.988 Papaya_Leaf_Healthy 24 24 0.991 1 0.995 0.995 Papaya_Leaf_Mosaic_Virus 13 13 1 0.942 0.995 0.909 Papaya_Leaf_Spot 21 21 0.991 1 0.995 0.995 Pointed_Gourd_Fruit_Healthy 16 16 0.995 1 0.995 0.928 Pointed_Gourd_Fruit_Rot 11 11 0.98 1 0.995 0.955 Pointed_Gourd_Leaf_Healthy 21 21 0.947 0.952 0.978 0.921 Pointed_Gourd_Leaf_Potassium_Deficiency 17 17 0.991 1 0.995 0.984 Teasel_Gourd_Fruit_Healthy 27 27 0.992 1 0.995 0.995 Teasel_Gourd_Fruit_Rot 25 25 1 0.974 0.995 0.966 Teasel_Gourd_Leaf_Blight 12 12 1 0.876 0.995 0.872 Teasel_Gourd_Leaf_Healthy 27 27 0.996 1 0.995 0.937 Teasel_Gourd_Leaf_Spot 11 11 0.992 1 0.995 0.949 Speed: 1.5ms preprocess, 23.8ms inference, 0.0ms loss, 1.9ms postprocess per image Results saved to /content/runs/detect/final_test_evaluation ============================================= 📊 Final Test Evaluation Results: Precision (P) : 0.9870 Recall (R) : 0.9858 mAP@50 : 0.9902 mAP@50-95 : 0.9553 ============================================= 📁 All confusion matrices and curves are saved to: runs/detect/final_test_evaluation
Hybrid Segmentation Evaluation: YOLOv11 BBox Coverage & BiRefNet Verification
In [ ]:
import os
import cv2
import torch
import zipfile
import numpy as np
from PIL import Image, ImageOps
from torchvision import transforms
from transformers import AutoModelForImageSegmentation
from ultralytics import YOLO
from tqdm import tqdm
from google.colab import drive
# ============================================================
# 1. Drive & Directory Setup
# ============================================================
if not os.path.exists('/content/drive/MyDrive'):
drive.mount('/content/drive')
dataset_zip_path = "/content/drive/MyDrive/Segmented_Dataset_Cleaned_Ratul.zip" # or zips_dir
extracted_dir = "/content/unzipped_raw_images"
best_yolo_path = "/content/drive/MyDrive/Final Thesis File/YOLO11_Thesis_Project_33to60/weights/best.pt"
audit_report_path = "/content/drive/MyDrive/yolo11_birefnet_evaluation_audit.txt"
os.makedirs(extracted_dir, exist_ok=True)
# ============================================================
# 2. Class Mapping (28 Classes)
# ============================================================
class_mapping = {
"Bottle_Gourd_Flower_Blossom_Blight": 0, "Bottle_Gourd_Flower_Healthy": 1,
"Bottle_Gourd_Fruit_Borer": 2, "Bottle_Gourd_Fruit_Healthy": 3,
"Bottle_Gourd_Leaf_Healthy": 4, "Bottle_Gourd_Leaf_Wilt": 5,
"Eggplant_Fruit_Borer": 6, "Eggplant_Fruit_Healthy": 7,
"Eggplant_Leaf_Healthy": 8, "Eggplant_Leaf_Mosaic_Virus": 9,
"Eggplant_Leaf_Wilt": 10, "Okra_Leaf_Healthy": 11,
"Okra_Leaf_Yellow_Vein_Mosaic_Virus": 12, "Papaya_Fruit_Anthracnose": 13,
"Papaya_Fruit_Healthy": 14, "Papaya_Leaf_Curl_Virus": 15,
"Papaya_Leaf_Healthy": 16, "Papaya_Leaf_Mosaic_Virus": 17,
"Papaya_Leaf_Spot": 18, "Pointed_Gourd_Fruit_Healthy": 19,
"Pointed_Gourd_Fruit_Rot": 20, "Pointed_Gourd_Leaf_Healthy": 21,
"Pointed_Gourd_Leaf_Potassium_Deficiency": 22, "Teasel_Gourd_Fruit_Healthy": 23,
"Teasel_Gourd_Fruit_Rot": 24, "Teasel_Gourd_Leaf_Blight": 25,
"Teasel_Gourd_Leaf_Healthy": 26, "Teasel_Gourd_Leaf_Spot": 27
}
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Device being used: {device}")
# ============================================================
# 3. Model Loading (YOLOv11 & BiRefNet)
# ============================================================
yolo_model = YOLO(best_yolo_path)
model = AutoModelForImageSegmentation.from_pretrained(
"ZhengPeng7/BiRefNet",
trust_remote_code=True
).to(device)
if device == "cuda":
model = model.half()
model.eval()
normalize_transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
# ============================================================
# 4. Helper Functions: Letterbox & HSV Fallback
# ============================================================
def letterbox_image(image, target_size=1024):
w, h = image.size
scale = target_size / max(w, h)
new_w, new_h = int(w * scale), int(h * scale)
resized_img = image.resize((new_w, new_h), Image.BILINEAR)
pad_left = (target_size - new_w) // 2
pad_top = (target_size - new_h) // 2
pad_right = target_size - new_w - pad_left
pad_bottom = target_size - new_h - pad_top
padded_img = ImageOps.expand(resized_img, border=(pad_left, pad_top, pad_right, pad_bottom), fill=(0, 0, 0))
return padded_img, (pad_left, pad_top, new_w, new_h)
def recover_fullframe_leaf(cv_img_rgb):
hsv = cv2.cvtColor(cv_img_rgb, cv2.COLOR_RGB2HSV)
mask = cv2.inRange(hsv, np.array([15, 20, 20]), np.array([95, 255, 255]))
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (15, 15))
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)
mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, kernel)
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
if contours:
c = max(contours, key=cv2.contourArea)
filled_mask = np.zeros_like(mask)
cv2.drawContours(filled_mask, [c], -1, 255, thickness=cv2.FILLED)
return filled_mask
return mask
# ============================================================
# 5. Hybrid Evaluation Pipeline (Bounding Box & Mask Verification)
# ============================================================
total_processed = 0
yolo_detected_count = 0
fallback_count = 0
fallback_list = []
for folder_name, class_id in class_mapping.items():
class_folder = os.path.join(extracted_dir, folder_name)
if not os.path.exists(class_folder):
continue
is_leaf_class = "leaf" in folder_name.lower()
images = [f for f in os.listdir(class_folder) if f.lower().endswith(('.png', '.jpg', '.jpeg'))]
print(f"\nProcessing class {class_id:02d}: {folder_name} (Leaf Mode: {is_leaf_class}, Total: {len(images)})...")
for img_name in tqdm(images, desc=folder_name):
total_processed += 1
img_path = os.path.join(class_folder, img_name)
# a. Image reading & dimension setup
orig_img = ImageOps.exif_transpose(Image.open(img_path)).convert("RGB")
w, h = orig_img.size
# b. Padding for leaf boundaries
work_img = ImageOps.expand(orig_img, border=(int(w * 0.20), int(h * 0.20)), fill=(125, 125, 125)) if is_leaf_class else orig_img
# c. Full-Frame BiRefNet Masking Evaluation
padded_input, (p_left, p_top, new_w, new_h) = letterbox_image(work_img, target_size=1024)
input_tensor = normalize_transform(padded_input).unsqueeze(0).to(device)
if device == "cuda":
input_tensor = input_tensor.half()
with torch.no_grad():
preds = model(input_tensor)[-1].sigmoid().cpu()
pred = preds.float().squeeze()
pred_mask = transforms.ToPILImage()(pred)
# d. YOLOv11 Bounding Box Detection Evaluation
results = yolo_model(orig_img, conf=0.25, max_det=1, verbose=False)[0]
boxes = results.boxes.xyxy.cpu().numpy()
if len(boxes) > 0:
yolo_detected_count += 1
else:
fallback_count += 1
fallback_list.append(f"{folder_name}/{img_name}")
# No images are being saved to disk; pipeline is for verification only
# ============================================================
# 6. Performance Audit Report Generation
# ============================================================
yolo_pct = (yolo_detected_count / total_processed) * 100 if total_processed > 0 else 0
fallback_pct = (fallback_count / total_processed) * 100 if total_processed > 0 else 0
audit_text = f"""================================================================================
YOLOv11 BBox Coverage & BiRefNet Hybrid Verification Audit
================================================================================
Total Processed Images : {total_processed}
YOLOv11 Successful Detections (Success) : {yolo_detected_count} ({yolo_pct:.2f}%)
YOLOv11 Failed -> BiRefNet (Fallback) : {fallback_count} ({fallback_pct:.2f}%)
================================================================================
[ Images where YOLOv11 failed to provide a box (Direct BiRefNet mask used) ]:
"""
for idx, fname in enumerate(fallback_list, 1):
audit_text += f"{idx:03d}. {fname}\n"
with open(audit_report_path, "w", encoding="utf-8") as f:
f.write(audit_text)
print("\n" + audit_text)
print(f"📄 Performance evaluation audit saved to: {audit_report_path}")
⚡ Raw images already available locally.
Device being used: cuda
Loading weights: 0%| | 0/754 [00:00<?, ?it/s]
Processing class 00: Bottle_Gourd_Flower_Blossom_Blight (Leaf Mode: False, Total: 62)...
Bottle_Gourd_Flower_Blossom_Blight: 100%|██████████| 62/62 [00:43<00:00, 1.42it/s]
Processing class 01: Bottle_Gourd_Flower_Healthy (Leaf Mode: False, Total: 71)...
Bottle_Gourd_Flower_Healthy: 100%|██████████| 71/71 [00:48<00:00, 1.46it/s]
Processing class 02: Bottle_Gourd_Fruit_Borer (Leaf Mode: False, Total: 87)...
Bottle_Gourd_Fruit_Borer: 100%|██████████| 87/87 [00:59<00:00, 1.47it/s]
Processing class 03: Bottle_Gourd_Fruit_Healthy (Leaf Mode: False, Total: 88)...
Bottle_Gourd_Fruit_Healthy: 100%|██████████| 88/88 [01:01<00:00, 1.43it/s]
Processing class 04: Bottle_Gourd_Leaf_Healthy (Leaf Mode: True, Total: 99)...
Bottle_Gourd_Leaf_Healthy: 100%|██████████| 99/99 [02:34<00:00, 1.56s/it]
Processing class 05: Bottle_Gourd_Leaf_Wilt (Leaf Mode: True, Total: 85)...
Bottle_Gourd_Leaf_Wilt: 100%|██████████| 85/85 [01:03<00:00, 1.33it/s]
Processing class 06: Eggplant_Fruit_Borer (Leaf Mode: False, Total: 62)...
Eggplant_Fruit_Borer: 100%|██████████| 62/62 [00:47<00:00, 1.30it/s]
Processing class 07: Eggplant_Fruit_Healthy (Leaf Mode: False, Total: 104)...
Eggplant_Fruit_Healthy: 100%|██████████| 104/104 [01:55<00:00, 1.11s/it]
Processing class 08: Eggplant_Leaf_Healthy (Leaf Mode: True, Total: 222)...
Eggplant_Leaf_Healthy: 100%|██████████| 222/222 [11:51<00:00, 3.21s/it]
Processing class 09: Eggplant_Leaf_Mosaic_Virus (Leaf Mode: True, Total: 104)...
Eggplant_Leaf_Mosaic_Virus: 100%|██████████| 104/104 [02:15<00:00, 1.30it/s]
Processing class 10: Eggplant_Leaf_Wilt (Leaf Mode: True, Total: 72)...
Eggplant_Leaf_Wilt: 100%|██████████| 72/72 [00:48<00:00, 1.50it/s]
Processing class 11: Okra_Leaf_Healthy (Leaf Mode: True, Total: 77)...
Okra_Leaf_Healthy: 100%|██████████| 77/77 [01:45<00:00, 1.36s/it]
Processing class 12: Okra_Leaf_Yellow_Vein_Mosaic_Virus (Leaf Mode: True, Total: 88)...
Okra_Leaf_Yellow_Vein_Mosaic_Virus: 100%|██████████| 88/88 [02:53<00:00, 1.96s/it]
Processing class 13: Papaya_Fruit_Anthracnose (Leaf Mode: False, Total: 89)...
Papaya_Fruit_Anthracnose: 100%|██████████| 89/89 [02:01<00:00, 1.37s/it]
Processing class 14: Papaya_Fruit_Healthy (Leaf Mode: False, Total: 87)...
Papaya_Fruit_Healthy: 100%|██████████| 87/87 [02:33<00:00, 1.76s/it]
Processing class 15: Papaya_Leaf_Curl_Virus (Leaf Mode: True, Total: 90)...
Papaya_Leaf_Curl_Virus: 100%|██████████| 90/90 [02:28<00:00, 1.65s/it]
Processing class 16: Papaya_Leaf_Healthy (Leaf Mode: True, Total: 120)...
Papaya_Leaf_Healthy: 100%|██████████| 120/120 [01:53<00:00, 1.06it/s]
Processing class 17: Papaya_Leaf_Mosaic_Virus (Leaf Mode: True, Total: 65)...
Papaya_Leaf_Mosaic_Virus: 100%|██████████| 65/65 [01:27<00:00, 1.35s/it]
Processing class 18: Papaya_Leaf_Spot (Leaf Mode: True, Total: 106)...
Papaya_Leaf_Spot: 100%|██████████| 106/106 [02:39<00:00, 1.51s/it]
Processing class 19: Pointed_Gourd_Fruit_Healthy (Leaf Mode: False, Total: 78)...
Pointed_Gourd_Fruit_Healthy: 100%|██████████| 78/78 [00:50<00:00, 1.56it/s]
Processing class 20: Pointed_Gourd_Fruit_Rot (Leaf Mode: False, Total: 52)...
Pointed_Gourd_Fruit_Rot: 100%|██████████| 52/52 [00:32<00:00, 1.60it/s]
Processing class 21: Pointed_Gourd_Leaf_Healthy (Leaf Mode: True, Total: 113)...
Pointed_Gourd_Leaf_Healthy: 100%|██████████| 113/113 [02:15<00:00, 1.20s/it]
Processing class 22: Pointed_Gourd_Leaf_Potassium_Deficiency (Leaf Mode: True, Total: 83)...
Pointed_Gourd_Leaf_Potassium_Deficiency: 100%|██████████| 83/83 [02:25<00:00, 1.76s/it]
Processing class 23: Teasel_Gourd_Fruit_Healthy (Leaf Mode: False, Total: 134)...
Teasel_Gourd_Fruit_Healthy: 100%|██████████| 134/134 [02:36<00:00, 1.17s/it]
Processing class 24: Teasel_Gourd_Fruit_Rot (Leaf Mode: False, Total: 120)...
Teasel_Gourd_Fruit_Rot: 100%|██████████| 120/120 [01:30<00:00, 1.33it/s]
Processing class 25: Teasel_Gourd_Leaf_Blight (Leaf Mode: True, Total: 61)...
Teasel_Gourd_Leaf_Blight: 100%|██████████| 61/61 [00:49<00:00, 1.23it/s]
Processing class 26: Teasel_Gourd_Leaf_Healthy (Leaf Mode: True, Total: 149)...
Teasel_Gourd_Leaf_Healthy: 100%|██████████| 149/149 [02:56<00:00, 1.18s/it]
Processing class 27: Teasel_Gourd_Leaf_Spot (Leaf Mode: True, Total: 62)...
Teasel_Gourd_Leaf_Spot: 100%|██████████| 62/62 [01:13<00:00, 1.18s/it]
================================================================================
YOLOv11 BBox Coverage & BiRefNet Hybrid Verification Audit
================================================================================
Total Processed Images : 2630
YOLOv11 Successful Detections (Success) : 2628 (99.92%)
YOLOv11 Failed -> BiRefNet (Fallback) : 2 (0.08%)
================================================================================
[ Images where YOLOv11 failed to provide a box (Direct BiRefNet mask used) ]:
001. Teasel_Gourd_Leaf_Blight/Teasel_Gourd_Leaf_Blight_TG_Leaf_Blight_051.jpg
002. Teasel_Gourd_Leaf_Blight/Teasel_Gourd_Leaf_Blight_TG_Leaf_Blight_046.jpg
📄 Performance evaluation audit saved to: /content/drive/MyDrive/yolo11_birefnet_evaluation_audit.txt