Yifeng-Liu's picture
Update README.md
2d799d8 verified
|
raw
history blame
3.84 kB
metadata
base_model: PekingU/rtdetr_r101vd_coco_o365
datasets: keremberke/satellite-building-segmentation
library_name: transformers
license: mit
metrics:
  - Average Precision (AP)
  - Average Recall (AR)
pipeline_tag: object-detection
tags:
  - remote sensing
  - object detection
widget:
  - src: img.png
    output:
      url: img.png
model-index:
  - name: rt-detr-finetuned-for-satellite-image-roofs-detection
    results:
      - task:
          type: object-detection
        dataset:
          name: keremberke/satellite-building-segmentation
          type: image-segmentation
        metrics:
          - type: AP (IoU=0.50:0.95)
            value: 0.434
            name: AP @ IoU=0.50:0.95 | area=all | maxDets=100
          - type: AP (IoU=0.50)
            value: 0.652
            name: AP @ IoU=0.50 | area=all | maxDets=100
          - type: AP (IoU=0.75)
            value: 0.464
            name: AP @ IoU=0.75 | area=all | maxDets=100
          - type: AP (IoU=0.50:0.95) small objects
            value: 0.248
            name: AP @ IoU=0.50:0.95 | area=small | maxDets=100
          - type: AP (IoU=0.50:0.95) medium objects
            value: 0.51
            name: AP @ IoU=0.50:0.95 | area=medium | maxDets=100
          - type: AP (IoU=0.50:0.95) large objects
            value: 0.632
            name: AP @ IoU=0.50:0.95 | area=large | maxDets=100
          - type: AR (IoU=0.50:0.95) maxDets=1
            value: 0.056
            name: AR @ IoU=0.50:0.95 | area=all | maxDets=1
          - type: AR (IoU=0.50:0.95) maxDets=10
            value: 0.328
            name: AR @ IoU=0.50:0.95 | area=all | maxDets=10
          - type: AR (IoU=0.50:0.95) maxDets=100
            value: 0.519
            name: AR @ IoU=0.50:0.95 | area=all | maxDets=100
          - type: AR (IoU=0.50:0.95) small objects
            value: 0.337
            name: AR @ IoU=0.50:0.95 | area=small | maxDets=100
          - type: AR (IoU=0.50:0.95) medium objects
            value: 0.601
            name: AR @ IoU=0.50:0.95 | area=medium | maxDets=100
          - type: AR (IoU=0.50:0.95) large objects
            value: 0.714
            name: AR @ IoU=0.50:0.95 | area=large | maxDets=100

Model Card

Roof Detection for Remote Sensing task.

Model Details

Model Description

  • Model type: Object Detection for Remote Sensing task.
  • License: MIT

Model Sources

Limitations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

How to Get Started with 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]