Exemple #1
0
    def test_testing(self):
        dataset = gtzan.GTZAN(self.root_dir, subset='testing')

        n_ite = 0
        for i, (waveform, sample_rate, label) in enumerate(dataset):
            self.assertEqual(waveform,
                             self.testing[i][0],
                             atol=5e-5,
                             rtol=1e-8)
            assert sample_rate == self.testing[i][1]
            assert label == self.testing[i][2]
            n_ite += 1
        assert n_ite == len(self.testing)
Exemple #2
0
 def test_testing_path(self):
     root_dir = Path(self.root_dir)
     test_dataset = gtzan.GTZAN(root_dir, subset='testing')
     self._test_testing(test_dataset)
Exemple #3
0
 def test_testing_str(self):
     test_dataset = gtzan.GTZAN(self.root_dir, subset='testing')
     self._test_testing(test_dataset)
Exemple #4
0
 def test_validation_path(self):
     root_dir = Path(self.root_dir)
     val_dataset = gtzan.GTZAN(root_dir, subset='validation')
     self._test_validation(val_dataset)
Exemple #5
0
 def test_validation_str(self):
     val_dataset = gtzan.GTZAN(self.root_dir, subset='validation')
     self._test_validation(val_dataset)