ayoubkirouane
commited on
Commit
·
842231b
1
Parent(s):
bf44ef5
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- ar
|
5 |
+
- en
|
6 |
+
library_name: transformers
|
7 |
+
pipeline_tag: object-detection
|
8 |
+
tags:
|
9 |
+
- climate
|
10 |
+
---
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
# DETR-BASE_Marine
|
15 |
+
|
16 |
+
## Overview
|
17 |
+
|
18 |
+
+ Model Name: DETR-BASE_Marine
|
19 |
+
+ Model Architecture: DETR (End-to-End Object Detection) with ResNet-50 backbone.
|
20 |
+
+ Model Type: Object Detection
|
21 |
+
+ Framework: PyTorch
|
22 |
+
+ Dataset: Aerial Maritime Image Dataset
|
23 |
+
+ License: MIT License (for the dataset)
|
24 |
+
|
25 |
+
|
26 |
+
## Model Description
|
27 |
+
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.
|
28 |
+
|
29 |
+
## Key Features:
|
30 |
+
+ Multi-class object detection.
|
31 |
+
+ Object classes: Docks, Boats, Lifts, Jetskis, Cars.
|
32 |
+
+ Robust performance in aerial and maritime scenarios.
|
33 |
+
|
34 |
+
## Use Cases
|
35 |
+
+ **Boat Counting**: Count the number of boats on water bodies, such as lakes, using drone imagery.
|
36 |
+
+ **Boat Lift Detection**: Identify the presence of boat lifts on the waterfront via aerial surveillance.
|
37 |
+
+ **Car Detection**: Detect and locate cars within maritime regions using UAV drones.
|
38 |
+
+ **Habitability Assessment**: Determine the level of inhabitation around lakes and water bodies based on detected objects.
|
39 |
+
+ **Property Monitoring**: Identify if visitors or activities are present at lake houses or properties using drone surveillance.
|
40 |
+
+ **Proof of Concept**: Showcase the potential of UAV imagery for maritime projects and object detection tasks.
|
41 |
+
|
42 |
+
## Dataset
|
43 |
+
+ **Dataset Name**: Aerial Maritime Image Dataset
|
44 |
+
+ **Number of Images**: 74
|
45 |
+
+ **Number of Bounding Boxes**: 1,151
|
46 |
+
+ **Collection Method**: Captured via Mavic Air 2 drone at 400 ft altitude.
|
47 |
+
|
48 |
+
## Usage
|
49 |
+
|
50 |
+
``` python
|
51 |
+
from transformers import DetrImageProcessor, DetrForObjectDetection
|
52 |
+
import torch
|
53 |
+
from PIL import Image
|
54 |
+
|
55 |
+
img_path = ""
|
56 |
+
image = Image.open(img_path)
|
57 |
+
|
58 |
+
extractor = AutoFeatureExtractor.from_pretrained("TuningAI/DETR-BASE_Marine")
|
59 |
+
model = AutoModelForObjectDetection.from_pretrained("TuningAI/DETR-BASE_Marine")
|
60 |
+
|
61 |
+
inputs = processor(images=image, return_tensors="pt")
|
62 |
+
outputs = model(**inputs)
|
63 |
+
|
64 |
+
# convert outputs (bounding boxes and class logits) to COCO API
|
65 |
+
# let's only keep detections with score > 0.9
|
66 |
+
target_sizes = torch.tensor([image.size[::-1]])
|
67 |
+
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
|
68 |
+
|
69 |
+
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
|
70 |
+
box = [round(i, 2) for i in box.tolist()]
|
71 |
+
print(
|
72 |
+
f"Detected {model.config.id2label[label.item()]} with confidence "
|
73 |
+
f"{round(score.item(), 3)} at location {box}"
|
74 |
+
)
|
75 |
+
|
76 |
+
```
|
77 |
+
|
78 |
+
|
79 |
+
## License
|
80 |
+
This model is provided under the MIT License.
|
81 |
+
The Aerial Maritime Image Dataset used for fine-tuning is also under the MIT License.
|