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

Bounding boxes prediction

You have trained an object recognition model. Now, you want to use to generate bounding boxes and classifications for a test image.

The model is available as model and it's already in the evaluation mode. The test_image is also available, and torch and torch.nn as nn have been imported.

Bu egzersiz

Deep Learning for Images with PyTorch

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

Egzersiz talimatları

  • Get the model's output for the test_image and assign it to output.
  • Extract the predicted bounding boxes from the output and assign them to boxes.
  • Extract the predicted scores from the output and assign them to scores.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Get model's prediction
with torch.no_grad():
    output = ____

# Extract boxes from the output
boxes = ____

# Extract scores from the output
scores = ____

print(boxes, scores)
Kodu Düzenle ve Çalıştır