BaşlayınÜcretsiz Başlayın

Anchor generator

Your team is developing object detection models based on the Faster R-CNN architecture and using pre-trained backbones. Your task is to create anchor boxes to serve as reference bounding boxes for proposing potential object regions.

You will create 9 standard anchors (3 box sizes and 3 aspect ratios).

torch has been import for you.

Bu egzersiz

Deep Learning for Images with PyTorch

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import AnchorGenerator from torchvision.models.detection.rpn.
  • Configure anchor sizes with 3 values: ((32, 64, 128),).
  • Configure aspect ratio with 3 values `((0.5, 1.0, 2.0),).
  • Instantiate AnchorGenerator with anchor_sizes and aspect_ratios.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import AnchorGenerator
____

# Configure anchor size
anchor_sizes = ____

# Configure aspect ratio
aspect_ratios = ____

# Instantiate AnchorGenerator
rpn_anchor_generator = ____
Kodu Düzenle ve Çalıştır