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

a-maci picture a-maci  路  3Comments

Abolfazl-Mehranian picture Abolfazl-Mehranian  路  3Comments

martinarjovsky picture martinarjovsky  路  4Comments

feiyangsuo picture feiyangsuo  路  3Comments

ArashJavan picture ArashJavan  路  3Comments