Esempio n. 1
0
                             101,
                             pretrained=pretrained,
                             class_agnostic=args.class_agnostic,
                             imagenet_weight=args.imagenet_weight)

    elif args.net == 'mobilenet_v2':
        fasterRCNN = mobilenet(imdb.classes,
                               'v2',
                               pretrained=pretrained,
                               class_agnostic=args.class_agnostic,
                               imagenet_weight=args.imagenet_weight)

    elif args.net == 'shufflenet_x05':
        fasterRCNN = shufflenet(imdb.classes,
                                'x05',
                                pretrained=pretrained,
                                class_agnostic=args.class_agnostic,
                                imagenet_weight=args.imagenet_weight)
    elif args.net == 'shufflenet_x10':
        fasterRCNN = shufflenet(imdb.classes,
                                'x10',
                                pretrained=pretrained,
                                class_agnostic=args.class_agnostic,
                                imagenet_weight=args.imagenet_weight)

    elif args.net == 'squeezenet_10':
        fasterRCNN = squeezenet(imdb.classes,
                                '10',
                                pretrained=pretrained,
                                class_agnostic=args.class_agnostic,
                                imagenet_weight=args.imagenet_weight)
Esempio n. 2
0
        fasterRCNN = resnet(pascal_classes,
                            50,
                            pretrained=False,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'res152':
        fasterRCNN = resnet(pascal_classes,
                            152,
                            pretrained=False,
                            class_agnostic=args.class_agnostic)
    elif args.net == 'mobilenet':
        fasterRCNN = mobilenet(pascal_classes,
                               pretrained=False,
                               class_agnostic=args.class_agnostic)
    elif args.net == 'shufflenet':
        fasterRCNN = shufflenet(pascal_classes,
                                pretrained=False,
                                class_agnostic=args.class_agnostic)
    else:
        print("network is not defined")
        pdb.set_trace()

    fasterRCNN.create_architecture()

    print("load checkpoint %s" % (load_name))
    if args.cuda > 0:
        checkpoint = torch.load(load_name)
    else:
        checkpoint = torch.load(load_name,
                                map_location=(lambda storage, loc: storage))
    fasterRCNN.load_state_dict(checkpoint['model'])
    if 'pooling_mode' in checkpoint.keys():