
前几篇文章写了如何使用maskrcnn训练自己的数据集以及如何在maskrcnn中加入pointrend模块,我使用的都是torchvision官方提供的maskrcnn,因为torchvison版本的mask rcnn是继承自FasterRCNN的,所以这里顺便介绍下如何使用torchvision的fasterrcnn网络训练自己的数据集。
1、Faster RCNN模型获取
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
def get_faste