Spaces:
Runtime error
Runtime error
Delete tools/features.py
Browse files- tools/features.py +0 -30
tools/features.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
#tools/features.py
|
| 2 |
-
|
| 3 |
-
import torch
|
| 4 |
-
from configs import DataConfig
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def load_dataset(data_config: DataConfig) -> BaseDataset:
|
| 8 |
-
'''
|
| 9 |
-
'''
|
| 10 |
-
datasets = {
|
| 11 |
-
'vsl_98': VSL98Dataset,
|
| 12 |
-
"vsl_400": VSL400Dataset,
|
| 13 |
-
}
|
| 14 |
-
return datasets[data_config.dataset](data_config)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
def rgb_collate_fn(examples) -> dict:
|
| 18 |
-
# permute to (num_frames, num_channels, height, width)
|
| 19 |
-
pixel_values = torch.stack(
|
| 20 |
-
[example["video"].permute(1, 0, 2, 3) for example in examples]
|
| 21 |
-
)
|
| 22 |
-
labels = torch.tensor([example["label"] for example in examples])
|
| 23 |
-
return {"pixel_values": pixel_values, "labels": labels}
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
def pose_collate_fn(examples) -> dict:
|
| 27 |
-
# permute to (num_frames, num_channels, height, width)
|
| 28 |
-
poses = torch.stack([example["pose"] for example in examples])
|
| 29 |
-
labels = torch.tensor([example["label"] for example in examples])
|
| 30 |
-
return {"poses": poses, "labels": labels}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|