| 32 | |
| 33 | @pytest.mark.parametrize("model_type", ["44khz", "24khz", "16khz"]) |
| 34 | def test_reconstruction(model_type): |
| 35 | # Test encoding |
| 36 | input_dir = Path(__file__).parent / "assets" / "input" |
| 37 | output_dir = input_dir.parent / model_type / "encoded_output" |
| 38 | args = { |
| 39 | "input": str(input_dir), |
| 40 | "output": str(output_dir), |
| 41 | "device": "cuda" if torch.cuda.is_available() else "cpu", |
| 42 | "model_type": model_type, |
| 43 | } |
| 44 | with argbind.scope(args): |
| 45 | run("encode") |
| 46 | |
| 47 | # Test decoding |
| 48 | input_dir = output_dir |
| 49 | output_dir = input_dir.parent / model_type / "decoded_output" |
| 50 | args = { |
| 51 | "input": str(input_dir), |
| 52 | "output": str(output_dir), |
| 53 | "model_type": model_type, |
| 54 | } |
| 55 | with argbind.scope(args): |
| 56 | run("decode") |
| 57 | |
| 58 | |
| 59 | def test_compression(): |