pytorch / pytorch/vision

Anchors not being properly distributed across feature maps?

Open
#2,135 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted module: documentation topic: object detection
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

*Edit: based on the rpn.py documentation, it sounds like this may be intended behavior for RPN - in which case this is really more of an issue in faster_rcnn, in the way that its default anchor sizes are specified. RPN docs note that "sizes[i] and aspect_ratios[i] can have an arbitrary number of elements," but this doesn't seem to be totally true - it looks like sizes[i] must have the same number of elements for all feature maps.

https://github.com/pytorch/vision/blob/d6ee8757eca7b74b98e5f0d434a565eb7b1c410b/torchvision/models/detection/rpn.py#L122

This zip statement will result in anchors being split up across each feature map, as opposed to computing all anchors at each feature map. For example, if anchor sizes are defined as ((8,), (16,), (32,), (64,), (128,)), the first feature map will only be processed using anchors size 8, the second feature map size 16, etc. Specifying a number of anchor sizes that is different from the number of feature maps will result in a crash, since the number of anchors and output predictions will not match.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RPN documentation and the zip statement in torchvision/models/detection/rpn.py at the referenced line. Verify how anchor sizes and aspect ratios are distributed across feature maps, including the default Faster R-CNN configuration and mismatched lengths. Done means the intended behavior is decided and the implementation and documentation agree without anchor or prediction-count mismatches.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.