コード例 #1
0
ファイル: multi_eval.py プロジェクト: xychen9459/TDRN
            BaseTransform(ssd_dim, dataset_mean),
            AnnotationTransform(dataset_name=args.dataset_name),
            dataset_name=args.dataset_name,
            set_file_name=args.set_file_name)
    elif args.dataset_name == 'UW':
        dataset = VOCDetection(
            UWroot, [(args.year, set_type)],
            BaseTransform(ssd_dim, dataset_mean),
            AnnotationTransform(dataset_name=args.dataset_name),
            dataset_name=args.dataset_name,
            set_file_name=args.set_file_name)

    if args.detection:
        if 'RFB' in args.backbone:
            from model.rfbnet_vgg import build_net
            net = build_net('test', ssd_dim, num_classes, bn=args.bn)
        elif 'RefineDet' in args.backbone:
            if args.deform:
                from model.dualrefinedet_vggbn import build_net
                net = build_net('test',
                                size=ssd_dim,
                                num_classes=num_classes,
                                c7_channel=args.c7_channel,
                                def_groups=args.deform,
                                multihead=args.multihead,
                                bn=args.bn)
            else:
                from model.refinedet_vgg import build_net
                net = build_net('test',
                                size=ssd_dim,
                                num_classes=num_classes,
コード例 #2
0
    if args.dataset_name == 'VOC0712':
        dataset = VOCDetection(VOCroot, [('2007', set_type)], BaseTransform(ssd_dim, dataset_mean),
                               AnnotationTransform(dataset_name=args.dataset_name), dataset_name=args.dataset_name )
    elif args.dataset_name == 'VID2017':
        dataset = VOCDetection(VIDroot, set_type, BaseTransform(ssd_dim, dataset_mean),
                               AnnotationTransform(dataset_name=args.dataset_name),
                               dataset_name=args.dataset_name, set_file_name=args.set_file_name)
    elif args.dataset_name == 'UW':
        dataset = VOCDetection(UWroot, set_type, BaseTransform(ssd_dim, dataset_mean),
                               AnnotationTransform(dataset_name=args.dataset_name),
                               dataset_name=args.dataset_name, set_file_name=args.set_file_name)

    if args.detection:
        if args.backbone in ['RFB_VGG']:
            from model.rfbnet_vgg import build_net
            net = build_net('test', ssd_dim, num_classes)
        elif args.backbone in ['RefineDet_VGG']:
            from model.refinedet_vgg import build_net
            net = build_net('test', size=ssd_dim, num_classes=num_classes, use_refine=args.refine)
        elif args.backbone[:6] == 'ResNet':
            from model.ssd_resnet import build_net
            net = build_net('test', backbone=args.backbone, prior=prior,size=ssd_dim, num_classes=num_classes, pm=args.pm)
        else:
            from model.ssd import build_net
            net = build_net('test', ssd_dim, num_classes, tssd=args.tssd,
                        prior=prior,
                        top_k=args.top_k,
                        thresh=args.confidence_threshold,
                        nms_thresh=args.nms_threshold,
                        attention=args.attention, #o_ratio=args.oa_ratio[0], a_ratio=args.oa_ratio[1],
                        bn=args.bn,