weecology / weecology/DeepForest

Allow users to modify input size

Open
#347 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Ideas for Machine Learning!
Dominant language
Python
Stars
774
Forks
265
PR merge metrics
No merged PRs in 30d

Description

def create_model(num_classes, nms_thresh, score_thresh, backbone = None):
    """Create a retinanet model
    Args:
        num_classes (int): number of classes in the model
        nms_thresh (float): non-max suppression threshold for intersection-over-union [0,1]
        score_thresh (float): minimum prediction score to keep during prediction  [0,1]
    Returns:
        model: a pytorch nn module
    """
    if not backbone:
        resnet = load_backbone()
        backbone = resnet.backbone
        
    model = RetinaNet(backbone=backbone, num_classes=num_classes)
    model.nms_thresh = nms_thresh
    model.score_thresh = score_thresh

    # Optionally allow anchor generator parameters to be created here
    # https://pytorch.org/vision/stable/_modules/torchvision/models/detection/retinanet.html

    return model

This is poorly documented in torchvision,

https://github.com/pytorch/vision/blob/97e0ea9c6ebc454538b3fa505e1d199547b0feed/torchvision/models/detection/transform.py#L43

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 create_model entry point shown in the issue, then read torchvision's detection/transform.py at the linked location to understand how input dimensions are handled. Define how callers should provide the input size and verify that the resulting RetinaNet model accepts it; the issue does not identify tests or a repository file to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.