Ejemplo n.º 1
0
        do_transforms=True,
        multi_scale=model.multi_scale)

    test_data = PascalDatasetYOLO(
        root_dir='../../../Data/VOCdevkit/VOC2007/',
        class_file='../../../Data/VOCdevkit/voc.names',
        dataset='test',
        batch_size=model.batch_size // model.subdivisions,
        image_size=model.default_image_size,
        anchors=model.anchors,
        strides=model.strides,
        do_transforms=False,
        multi_scale=False,
        return_targets=False)

    model.load_weights('models/yolov2-tiny.conv.13', only_imagenet=True)
    model = model.to(device)

    if train:
        set_random_seed(12345)

        model.mini_freeze()
        optimizer = optim.SGD(model.get_trainable_parameters(),
                              lr=model.lr,
                              momentum=model.momentum,
                              weight_decay=model.weight_decay,
                              nesterov=True)
        scheduler = step_decay_scheduler(optimizer,
                                         steps=model.steps,
                                         scales=model.scales)
Ejemplo n.º 2
0
        multi_scale=model.multi_scale)

    test_data = PascalDatasetYOLO(
        root_dir='../../../Data/VOCdevkit/VOC2007/',
        class_file='../../../Data/VOCdevkit/voc.names',
        dataset='test',
        batch_size=model.batch_size // model.subdivisions,
        image_size=model.default_image_size,
        anchors=model.anchors,
        strides=model.strides,
        skip_difficult=False,
        do_transforms=False,
        multi_scale=False,
        return_targets=False)

    model.load_weights('models/yolov3-tiny.conv.11', only_imagenet=True)
    model = model.to(device)

    if train:
        set_random_seed(12345)

        model.unfreeze()
        optimizer = optim.SGD(model.get_trainable_parameters(),
                              lr=model.lr,
                              momentum=model.momentum,
                              weight_decay=model.weight_decay,
                              nesterov=True)
        scheduler = step_decay_scheduler(optimizer,
                                         steps=model.steps,
                                         scales=model.scales)
Ejemplo n.º 3
0
                                 strides=model.strides,
                                 do_transforms=False,
                                 multi_scale=model.multi_scale)

    test_data = PascalDatasetYOLO(root_dir='../../../Data/SS/',
                                  class_file='../../../Data/SS/ss.names',
                                  dataset='test',
                                  batch_size=model.batch_size //
                                  model.subdivisions,
                                  image_size=model.default_image_size,
                                  anchors=model.anchors,
                                  strides=model.strides,
                                  do_transforms=False,
                                  multi_scale=model.multi_scale)

    model.load_weights('models/darknet53_448.weights', only_imagenet=True)
    model = model.to(device)

    if train:
        set_random_seed(12345)

        model.mini_freeze()
        optimizer = optim.SGD(model.get_trainable_parameters(),
                              lr=model.lr,
                              momentum=model.momentum,
                              weight_decay=model.weight_decay,
                              nesterov=True)
        scheduler = step_decay_scheduler(optimizer,
                                         steps=model.steps,
                                         scales=model.scales)