def convert_to_config_list(initial_list):
    if initial_list is None or initial_list == []:
        raise ValueError(
            "manifest_filepaths and tarred_audio_filepaths must not be empty.")
    if not isinstance(initial_list, ListConfig):
        initial_list = ListConfig([initial_list])

    for list_idx, list_val in enumerate(initial_list):
        if type(list_val) != type(initial_list[0]):
            raise ValueError(
                "manifest_filepaths and tarred_audio_filepaths need to be a list of lists for bucketing or just a list of strings"
            )
    if type(initial_list[0]) is not ListConfig:
        initial_list = ListConfig([initial_list])
    return initial_list
Example #2
0
 def test_lottery_transform(self):
     """
     test the lottery transform when params are indicated in the yaml
     """
     pos = torch.randn(10000, 3)
     x = torch.randn(10000, 6)
     dummy = torch.randn(10000, 6)
     data = Data(pos=pos, x=x, dummy=dummy)
     conf = ListConfig([{"transform": "GridSampling3D", "params": {"size": 0.1}}, {"transform": "Center"},])
     tr = LotteryTransform(transform_options=conf)
     tr(data)
     self.assertIsInstance(tr.random_transforms.transforms[0], GridSampling3D)
     self.assertIsInstance(tr.random_transforms.transforms[1], T.Center)
Example #3
0
 def test_InstantiateTransforms(self):
     conf = ListConfig([
         {
             "transform": "GridSampling",
             "params": {
                 "size": 0.1
             }
         },
         {
             "transform": "Center"
         },
     ])
     t = instantiate_transforms(conf)
     self.assertIsInstance(t.transforms[0], GridSampling)
     self.assertIsInstance(t.transforms[1], T.Center)