climate

DETR-BASE_Marine

Overview

Model Description

The DETR-BASE_Marine Aerial Maritime Detector is a deep learning model based on the DETR architecture with a ResNet-50 backbone. It has been fine-tuned on the "Aerial Maritime Image Dataset," which comprises 74 aerial photographs captured via a Mavic Air 2 drone. The model is designed for object detection tasks in maritime environments and can identify and locate various objects such as docks, boats, lifts, jetskis, and cars in aerial images.

Key Features:

Use Cases

Dataset

Usage

from transformers import DetrImageProcessor, DetrForObjectDetection
import torch
from PIL import Image

img_path = ""
image = Image.open(img_path)

extractor = AutoFeatureExtractor.from_pretrained("TuningAI/DETR-BASE_Marine")
model = AutoModelForObjectDetection.from_pretrained("TuningAI/DETR-BASE_Marine")

inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)

# convert outputs (bounding boxes and class logits) to COCO API
# let's only keep detections with score > 0.9
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]

for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
    box = [round(i, 2) for i in box.tolist()]
    print(
            f"Detected {model.config.id2label[label.item()]} with confidence "
            f"{round(score.item(), 3)} at location {box}"
    )

License

This model is provided under the MIT License.

The Aerial Maritime Image Dataset used for fine-tuning is also under the MIT License.