Load depth data from an NPY file. Args: exr_path (str): Path to the NPY file. Returns: numpy.ndarray: Depth data as a NumPy array.
(exr_path)
| 19 | |
| 20 | |
| 21 | def load_depth_npy(exr_path): |
| 22 | """ |
| 23 | Load depth data from an NPY file. |
| 24 | Args: |
| 25 | exr_path (str): Path to the NPY file. |
| 26 | Returns: |
| 27 | numpy.ndarray: Depth data as a NumPy array. |
| 28 | """ |
| 29 | try: |
| 30 | depth_map = np.load(exr_path) |
| 31 | depth_map = np.nan_to_num(depth_map, nan=0.0, posinf=0.0, neginf=0.0) |
| 32 | return depth_map |
| 33 | except Exception as e: |
| 34 | print(f"Error loading NPY file {exr_path}: {e}") |
| 35 | return None |
| 36 | |
| 37 | |
| 38 | def load_depth_exr(exr_path): |
no test coverage detected