Ejemplo n.º 1
0
def get_transform(train, args):
    if train:
        return presets.DetectionPresetTrain(args.data_augmentation)
    elif not args.weights:
        return presets.DetectionPresetEval()
    else:
        weights = PM.get_weight(args.weights)
        return weights.transforms()
Ejemplo n.º 2
0
def get_transform(train, args):
    if train:
        return presets.DetectionPresetTrain(data_augmentation=args.data_augmentation)
    elif args.weights and args.test_only:
        weights = torchvision.models.get_weight(args.weights)
        trans = weights.transforms()
        return lambda img, target: (trans(img), target)
    else:
        return presets.DetectionPresetEval()
Ejemplo n.º 3
0
def get_transform(train, args):
    if train:
        return presets.DetectionPresetTrain(args.data_augmentation)
    elif not args.prototype:
        return presets.DetectionPresetEval()
    else:
        if args.weights:
            weights = prototype.models.get_weight(args.weights)
            return weights.transforms()
        else:
            return prototype.transforms.CocoEval()
Ejemplo n.º 4
0
def get_transform(train):
    return presets.DetectionPresetTrain(
    ) if train else presets.DetectionPresetEval()
Ejemplo n.º 5
0
def get_transform(train, data_augmentation):
    return presets.DetectionPresetTrain(
        data_augmentation) if train else presets.DetectionPresetEval()