Skip to content

How to import a fine-tunable detectron 2 model? #5266

Discussion options

You must be logged in to vote

Here is an expample with X101-FPN:

def fasterrcnn_dectron2(
    model_str,
    model_weight_str=None,
    pretrained=True,
    num_classes=91,
    trainable_backbone_layers=0
):
    """
    Constructs a Faster R-CNN model with an X101-FPN backbone from the Detectron2 model zoo.

    The input to the model is expected to be a list of tensors, each of shape [C, H, W], one for each
    image, and should be in the range [0, 1]. Different images can have different sizes.

    The behavior of the model changes depending if it is in training or evaluation mode.

    During training, the model expects both the input tensors, as well as targets (list of dictionary),
    containing:

        - "ins…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidatuken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants