A fine-tuned YOLOv8 nano model for detecting military and civilian objects in images. Trained on a custom military imagery dataset covering 12 object categories.
Fuente del modelo
Descripción de la fuente
A fine-tuned YOLOv8 nano model for detecting military and civilian objects in images.
Trained on a custom military imagery dataset covering 12 object categories.
Fuentes
1 fuenteVerificado 9 sept
Artefactos del modelo
2 artefactosExtractos de fuentes
2 extractos| Property | Value |
|---|
| Architecture | YOLOv8n (nano) |
| Parameters | ~3.0 M |
| GFLOPs | 8.2 |
| Model size | 24.5 MB |
| Task | Object Detection |
| Input size | 640 × 640 |
| Framework | Ultralytics 8.x |
A custom-collected military imagery dataset containing annotated images of battlefield and civilian scenes.
| Property | Value |
|---|---|
| Number of classes | 12 |
| Annotation format | YOLO (normalized bounding boxes) |
| Image sources | Open-source military imagery |
| Augmentations | Mosaic, flip, HSV shift, scale |
| ID | Class |
|---|---|
| 0 | camouflage_soldier |
| 1 | weapon |
| 2 | military_tank |
| 3 | military_truck |
| 4 | military_vehicle |
| 5 | civilian |
| 6 | soldier |
| 7 | civilian_vehicle |
| 8 | military_artillery |
| 9 | trench |
| 10 |
| Hyperparameter | Value |
|---|---|
| Base model | YOLOv8n |
| Optimizer | AdamW (auto) |
| Epochs | 100 |
| Image size | 640 |
| Batch size | 16 |
| Confidence threshold (inference) | 0.40 |
| IoU threshold (NMS) | 0.50 |
| Device | CPU / CUDA |
Metrics measured on the held-out validation split.
| Metric | Value |
|---|---|
| mAP@50 | ~0.72 |
| mAP@50-95 | ~0.48 |
| Precision | ~0.74 |
| Recall | ~0.68 |
| Inference speed (CPU, 320 px) | ~120 ms/image |
Note: Exact per-class metrics depend on dataset split and augmentation seed.
pip install ultralytics
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
# Download weights
model_path = hf_hub_download(
repo_id="datasidahmed/YOLOV8",
filename="best.pt"
)
# Load model
model = YOLO(model_path)
from ultralytics import YOLO
model = YOLO("best.pt") # if best.pt is already in the working directory
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
model_path = hf_hub_download(repo_id="datasidahmed/YOLOV8", filename="best.pt")
model = YOLO(model_path)
# Single image
results = model.predict("image.jpg", conf=0.40, iou=0.50)
# Display results
for r in results:
for box in r.boxes:
cls_id = int(box.cls[0])
conf = float(box.conf[0])
x1,y1,x2,y2 = map(int, box.xyxy[0])
print(f"{model.names[cls_id]}: {conf:.2f} [{x1},{y1},{x2},{y2}]")
# Save annotated image
results[0].save("output.jpg")
results = model.predict("images/", conf=0.40, save=True)
model.export(format="onnx", imgsz=640)
military_warship, military_aircraft, and trench have fewer training samples and may exhibit lower recall.If you use this model in your research or project, please cite:
@misc{melainin2024militarydetection,
author = {Sidahmed Melainin},
title = {Military Object Detection using YOLOv8},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/datasidahmed/YOLOV8}
}
Sidahmed Melainin
GitHub: Melainin2
--- license: mit language: - en tags: - object-detection - yolov8 - military - ultralytics - computer-vision pipeline_tag: object-detection library_name: ultralytics --- # Military Object Detection — YOLOv8n A fine-tuned **YOLOv8 nano** model for detecting military and civilian objects in images. Trained on a custom military imagery dataset covering 12 object categories. --- ## Model Description | Property | Value | |---|---| | Architecture | YOLOv8n (nano) | | Parameters | ~3.0 M | | GFLOPs | 8.2 | | Model size | 24.5 MB | | Task | Object Detection | | Input size | 640 × 640 | | Framework | Ultralytics 8.x | --- ## Dataset A custom-collected military imagery dataset containing annotated images of battlefield and civilian scenes. | Property | Value | |---|---| | Number of classes | 12 | | Annotation format | YOLO (normalized bounding boxes) | | Image sources | Open-source military imagery | | Augmentations | Mosaic, flip, HSV shift, scale | ### Class Names | ID | Class | |---|---| | 0 | `camouflage_soldier` | | 1 | `weapon` | | 2 | `military_tank` | | 3 | `military_truck` | | 4 | `military_vehicle` | | 5 | `civilian` | | 6 | `soldier` | | 7 | `civilian_vehicle` | | 8 | `military_artillery` | | 9 | `trench` | | 10 | `military_aircraft` | | 11 | `military_warship` | --- ## Training Configuration | Hyperparameter | Value | |---|---| | Base model | YOLOv8n | | Optimizer | AdamW (auto) | | Epochs | 100 | | Image size | 640 | | Batch size | 16 | | Confidence threshold (inference) | 0.40 | | IoU threshold (NMS) | 0.50 | | Device | CPU / CUDA | --- ## Performance Metrics > Metrics measured on the held-out validation split. | Metric | Value | |---|---| | mAP@50 | ~0.72 | | mAP@50-95 | ~0.48 | | Precision | ~0.74 | | Recall | ~0.68 | | Inference speed (CPU, 320 px) | ~120 ms/image | *Note: Exact per-class metrics depend on dataset split and augmentation seed.* --- ## Inference ### Install dependencies ```bash pip install ultralytics ``` ### Load from Hugging Face Hub ```python from huggingface_hub import hf_hub_download from ultralytics import YOLO # Download weights model_path = hf_hub_download( repo_id="datasidahmed/YOLOV8", filename="best.pt" ) # Load model model = YOLO(model_path) ``` ### Or load directly by filename ```python from ultralytics import YOLO model = YOLO("best.pt") # if best.pt is already in the working directory ``...
Source context: 24 downloads · 0 likes · Pipeline object-detection · Library ultralytics · Repo datasidahmed/YOLOV8
military_aircraft| 11 | military_warship |