prototype pipeline

This commit is contained in:
2022-12-09 23:11:15 +00:00
parent 9d98638980
commit f4145463ee
5 changed files with 144 additions and 12 deletions
+7 -3
View File
@@ -1,6 +1,8 @@
import os
import sys
os.environ["CUDA_VISIBLE_DEVICES"] = '1'
import math
import torch
import torchvision as tv
@@ -18,14 +20,16 @@ class Dataset(Dataset):
return len(self.frames)
def __getitem__(self, idx):
img_path = os.path.join(self.folder, 'mesh_posed', self.frames[idx])
image = np.load(img_path)['mesh_posed']
path = os.path.join(self.folder, 'mesh_posed', self.frames[idx])
mesh_posed = np.load(path)['mesh_posed']
# image = self.transforms(image)
return image
return { 'mesh_posed': mesh_posed }
if __name__ == '__main__':
from torch.utils.data import DataLoader
device = "cuda" if torch.cuda.is_available() else "cpu"
dataset = Dataset('/home/workspace/local-data/train')
train_dataloader = DataLoader(dataset, batch_size=4, drop_last=True, num_workers=2)