Downloads · 30 days
104
5% of all-time downloads
spencercdz/YOLOv8m_defence
YOLOv8m_defence is a object detection model from spencercdz. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as apache-2.0.
YOLOv8m Defence is a specialized object detection model fine-tuned from the ultralytics/YOLOv8 checkpoint for defence and transportation applications. The model was trained for over 50 epochs on a private defence-rela…
Downloads · 30 days
104
5% of all-time downloads
All-time downloads
2K
Public
Repo size
156 MB
Likes
4
Public
Click a slice to open those files.
.pt156 MB · 100%
From the Hugging Face model README
YOLOv8m Defence is a specialized object detection model fine-tuned from the ultralytics/YOLOv8 checkpoint for defence and transportation applications. The model was trained for over 50 epochs on a private defence-related dataset to detect 18 categories of aircraft, vehicles, and ships with high accuracy and low latency requirements.
A deployment of the model is available at Hugging Face Spaces for demonstration of its capabilities.
The model detects the following 18 object categories:
| Class ID | Object Type |
|---|---|
| 0 | Cargo Aircraft |
| 1 | Commercial Aircraft |
| 2 | Drone |
| 3 | Fighter Jet |
| 4 | Fighter Plane |
| 5 | Helicopter |
| 6 | Light Aircraft |
| 7 | Missile |
| 8 | Truck |
| 9 | Car |
| 10 | Tank |
| 11 | Bus |
| 12 | Van |
| 13 | Cargo Ship |
| 14 | Yacht |
| 15 | Cruise Ship |
| 16 | Warship |
| 17 | Sailboat |
The model achieved the following performance metrics in its original evaluation environment:
Note: These scores were achieved with the fully optimized TensorRT version. The PyTorch model provided here may have different performance characteristics.
pip install ultralytics
from ultralytics import YOLO
from PIL import Image
# Load the model
model = YOLO('path/to/yolov8m_defence.pt')
# Run inference
results = model('path/to/your/image.jpg')
# Process results
for r in results:
print(f"Detected {len(r.boxes)} objects")
for box in r.boxes:
# Get bounding box coordinates
x1, y1, x2, y2 = box.xyxy[0]
bbox = [int(x1), int(y1), int(x2 - x1), int(y2 - y1)]
# Get class and confidence
class_id = int(box.cls[0])
confidence = float(box.conf[0])
class_name = model.names[class_id]
print(f" {class_name} (ID: {class_id}): {confidence:.2f} at {bbox}")
# Run inference on multiple images
results = model(['image1.jpg', 'image2.jpg', 'image3.jpg'])
for i, r in enumerate(results):
print(f"Image {i+1}: {len(r.boxes)} detections")
# Display results with bounding boxes
results = model('image.jpg')
annotated_image = results[0].plot()
# Convert BGR to RGB for display
from PIL import Image
import numpy as np
Image.fromarray(annotated_image[..., ::-1]).show()
The original model underwent additional optimization including:
This repository contains the pre-optimization PyTorch model for maximum compatibility and ease of use.
This model is designed for defence and security applications. Users should:
@misc{yolov8_ultralytics,
author = {Jocher, Glenn and Chaurasia, Ayush and Qiu, Jing},
title = {YOLO by Ultralytics},
year = {2023},
howpublished = {\url{https://github.com/ultralytics/ultralytics}},
}
This model is released under the Apache 2.0 License.
For questions about this model card or the model itself, please refer to the repository issues or contact the model authors.