深度學習三維重建-3DMM
? ?# 獲取隨即裁剪的參數(shù)
? ?rect = torchvision.transforms.RandomCrop.get_params(feature,(height,width))
? ?# 按照剛設(shè)定的值,裁剪特征
? ?feature = torchvision.transforms.functional.crop(feature, *rect)
? ?# 按照剛設(shè)定的值,裁剪標簽
? ?label = torchvision.transforms.functional.crop(label, *rect)
? ?return feature, label
imgs = []# n=5# 隨機裁剪5個觀察結(jié)果for _ in range(n):
? ?imgs += voc_rand_crop(train_features[0], train_labels[0], 200, 300)imgs = [img.permute(1, 2, 0) for img in imgs]# 因為他輸出的是feature,label,所需需要隔一個跳一個
標簽: