This commit is contained in:
2026-08-03 17:45:58 +08:00
parent a55d449028
commit 4637af4f81
2 changed files with 318 additions and 2 deletions
+2 -2
View File
@@ -21,10 +21,10 @@ train_transform = transforms.Compose([
transforms.CenterCrop(input_size),
transforms.RandomHorizontalFlip(p=0.5), # 50%的概率(p=0.5)水平翻转图片
transforms.RandomRotation(10), # 轻微旋转
transforms.ColorJitter(brightness=0.1, contrast=0.1),
transforms.ColorJitter(brightness=0.1, contrast=0.1), # 随机亮度和对比度
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
transforms.RandomErasing(p=0.5, scale=(0.02, 0.2), ratio=(0.3, 3.3)),
# transforms.RandomErasing(p=0.5, scale=(0.02, 0.2), ratio=(0.3, 3.3)),
])