Download tests/test_core.py from junaid-simamdigital/SimamAnything2GS: direct link, hf CLI and curl.
- Browser
- Download file 560 Bytes
-
https://huggingface.co/spaces/junaid-simamdigital/SimamAnything2GS/resolve/main/tests/test_core.py
- Command line
-
hf download hf://spaces/junaid-simamdigital/SimamAnything2GS/tests/test_core.py
-
curl -L -o test_core.py https://huggingface.co/spaces/junaid-simamdigital/SimamAnything2GS/resolve/main/tests/test_core.py
560 Bytes
| import numpy as np | |
| from core import image_billboard_points, write_preview_ply | |
| def test_billboard_preview_is_finite_and_colored(tmp_path): | |
| image = np.zeros((4, 6, 3), dtype=np.uint8) | |
| image[..., 0] = 200 | |
| points, colors = image_billboard_points(image, max_side=6) | |
| assert points.shape == (24, 3) | |
| assert colors.shape == (24, 3) | |
| assert np.isfinite(points).all() | |
| assert np.all(colors[:, 0] == 200) | |
| path = write_preview_ply(tmp_path / "preview.ply", points, colors) | |
| assert "element vertex 24" in path.read_text(encoding="utf-8") | |