Vision: Maskrcnn with different backbone

Created on 22 Aug 2019  路  1Comment  路  Source: pytorch/vision

@fmassa How can we add more resnet backbones to existing mask rcnn model ? Currently it supports only resnet50.

models question object detection

Most helpful comment

When you call this function to define your model torchvision.models.detection.__dict__['FasterRCNN']
you can set your backbone like this:
torchvision.models.detection.__dict__['FasterRCNN'](backbone, num_classes = 2, anchor_generator) of course you can set your own anchor_generator as well.

The most simple way to put other backbone is
using torchvision supported model. Ex) backbone = torchvision.models.mobilenet_v2(pretrained=pretrained).features
backbone.out_channels = 1280 like this.

>All comments

When you call this function to define your model torchvision.models.detection.__dict__['FasterRCNN']
you can set your backbone like this:
torchvision.models.detection.__dict__['FasterRCNN'](backbone, num_classes = 2, anchor_generator) of course you can set your own anchor_generator as well.

The most simple way to put other backbone is
using torchvision supported model. Ex) backbone = torchvision.models.mobilenet_v2(pretrained=pretrained).features
backbone.out_channels = 1280 like this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

h6197627 picture h6197627  路  23Comments

timonbimon picture timonbimon  路  28Comments

mcleonard picture mcleonard  路  26Comments

zsef123 picture zsef123  路  23Comments

JingyunLiang picture JingyunLiang  路  26Comments