Downloads · 30 days
3.3K
7% of all-time downloads
Yifeng-Liu/rt-detr-finetuned-for-satellite-image-roofs-detection
rt-detr-finetuned-for-satellite-image-roofs-detection is a object detection model from Yifeng-Liu. Use it when you need objects located in an image. It is set up for transformers. The card lists the license as mit.
Roof detection model for remote sensing imagery, fine-tuned using RT-DETR.
Downloads · 30 days
3.3K
7% of all-time downloads
All-time downloads
44.9K
Public
Parameters
76.6M
920 MB on disk
Likes
19
Trending 1
Click a slice to open those files.
.safetensors307 MB · 100%
From the Hugging Face model README
Roof detection model for remote sensing imagery, fine-tuned using RT-DETR.
<!-- Provide a quick summary of what the model is/does. -->The following example shows roof detections produced by the model:

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
Use the code below to get started with the model.
from transformers import AutoModelForObjectDetection, AutoImageProcessor
import torch
import cv2
image_path=YOUR_IMAGE_PATH
image = cv2.imread(image_path)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = AutoModelForObjectDetection.from_pretrained("Yifeng-Liu/rt-detr-finetuned-for-satellite-image-roofs-detection")
image_processor = AutoImageProcessor.from_pretrained("Yifeng-Liu/rt-detr-finetuned-for-satellite-image-roofs-detection")
CONFIDENCE_TRESHOLD = 0.5
with torch.no_grad():
model.to(device)
# load image and predict
inputs = image_processor(images=image, return_tensors='pt').to(device)
outputs = model(**inputs)
# post-process
target_sizes = torch.tensor([image.shape[:2]]).to(device)
results = image_processor.post_process_object_detection(
outputs=outputs,
threshold=CONFIDENCE_TRESHOLD,
target_sizes=target_sizes
)[0]