| 89 | return CodecArtifacts(name="npz_debug", files=files) |
| 90 | |
| 91 | def decode(self, frame_dir: Path, artifacts: CodecArtifacts, quant_ctx: QuantizationContext) -> TensorDict: |
| 92 | restored: TensorDict = {} |
| 93 | for name, meta in artifacts.files.items(): |
| 94 | file_type = meta.get("type") |
| 95 | if file_type not in {"npz_int", "npz_float"}: |
| 96 | raise ValueError(f"NPZ codec received unsupported file type '{file_type}' for '{name}'.") |
| 97 | data = np.load(frame_dir / meta["file"])["data"] |
| 98 | restored[name] = torch.from_numpy(data.astype(np.float32)) |
| 99 | return restored |
| 100 | |
| 101 | |
| 102 | class PNGCodec: |