mlx3d 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlx3d-0.3.0/.github/PULL_REQUEST_TEMPLATE.md +19 -0
- mlx3d-0.3.0/.github/workflows/publish.yml +106 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/.github/workflows/tests.yml +2 -1
- {mlx3d-0.2.0 → mlx3d-0.3.0}/.gitignore +3 -0
- mlx3d-0.3.0/CHANGELOG.md +116 -0
- mlx3d-0.3.0/CITATION.cff +18 -0
- mlx3d-0.3.0/CODE_OF_CONDUCT.md +77 -0
- mlx3d-0.3.0/CONTRIBUTING.md +82 -0
- mlx3d-0.3.0/LICENSE +21 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/PKG-INFO +108 -25
- mlx3d-0.3.0/README.md +194 -0
- mlx3d-0.3.0/SECURITY.md +26 -0
- mlx3d-0.3.0/docs/api/capture.md +3 -0
- mlx3d-0.3.0/docs/assets/capture_castle.jpg +0 -0
- mlx3d-0.3.0/docs/assets/fast_4dgs_juggle.mp4 +0 -0
- mlx3d-0.3.0/docs/assets/fast_4dgs_juggle_strip.png +0 -0
- mlx3d-0.3.0/docs/assets/fast_truck_diff_x50.png +0 -0
- mlx3d-0.3.0/docs/assets/fast_truck_fast.png +0 -0
- mlx3d-0.3.0/docs/assets/fast_truck_reference.png +0 -0
- mlx3d-0.3.0/docs/tutorials/capture.md +148 -0
- mlx3d-0.3.0/docs/tutorials/fast_rendering.md +165 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/mesh_rendering.md +26 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/viewer.md +4 -1
- mlx3d-0.3.0/examples/benchmark_fast_rasterization.py +122 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/extract_mesh.py +11 -6
- mlx3d-0.3.0/examples/play_dynamic_gaussians.py +179 -0
- mlx3d-0.3.0/examples/sdf_csg.py +81 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/mkdocs.yml +3 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/pyproject.toml +31 -2
- mlx3d-0.3.0/src/mlx3d/__init__.py +49 -0
- mlx3d-0.3.0/src/mlx3d/_version.py +24 -0
- mlx3d-0.3.0/src/mlx3d/capture/__init__.py +30 -0
- mlx3d-0.3.0/src/mlx3d/capture/colmap_wrap.py +136 -0
- mlx3d-0.3.0/src/mlx3d/capture/frames.py +198 -0
- mlx3d-0.3.0/src/mlx3d/capture/pipeline.py +436 -0
- mlx3d-0.3.0/src/mlx3d/capture/sfm.py +570 -0
- mlx3d-0.3.0/src/mlx3d/cli/capture.py +115 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cli/render.py +14 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/datasets/__init__.py +2 -1
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/datasets/colmap.py +107 -4
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/nerf.py +6 -1
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/__init__.py +26 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/marching_cubes.py +25 -2
- mlx3d-0.3.0/src/mlx3d/ops/sdf.py +308 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/mesh.py +15 -4
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/__init__.py +3 -0
- mlx3d-0.3.0/src/mlx3d/splatting/fast.py +703 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/trainer.py +32 -10
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/viewer/__main__.py +6 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/viewer/server.py +29 -3
- mlx3d-0.3.0/tests/test_capture.py +326 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_nerf_renderer.py +30 -0
- mlx3d-0.3.0/tests/test_ops_sdf.py +81 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_splatting.py +45 -0
- mlx3d-0.3.0/tests/test_splatting_fast.py +162 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_viewer.py +14 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/uv.lock +233 -3
- mlx3d-0.2.0/.github/workflows/publish.yml +0 -40
- mlx3d-0.2.0/CHANGELOG.md +0 -42
- mlx3d-0.2.0/LICENSE +0 -674
- mlx3d-0.2.0/README.md +0 -119
- mlx3d-0.2.0/src/mlx3d/__init__.py +0 -34
- {mlx3d-0.2.0 → mlx3d-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/.github/workflows/documentation.yml +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/Logo.jpeg +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/cameras.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/datasets.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/io.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/losses.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/nn.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/ops.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/renderer.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/splatting.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/structures.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/transforms.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/utils.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/api/viewer.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/gallery_gsplat.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/gallery_nerf.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/logo.jpeg +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/mlx3d-icon.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/mlx3d-logo.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/render_aa.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/render_lit_sphere.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/render_lit_torus.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/render_normals.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/render_textured.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/v020_lego_ngp.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/v020_truck_depth_hi.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/v020_truck_normals_hi.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/assets/v020_truck_render_hi.png +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/benchmarks.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/conventions.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/index.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/quickstart.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/extending.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/gaussian_splatting.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/hashgrid_nerf.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/mesh_lighting.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/mesh_optimization.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/nerf.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/docs/tutorials/pointcloud_fitting.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/README.md +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/benchmark.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/benchmark_gaussian_splatting.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/extend_renderer.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/fit_gaussians.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/fit_mesh.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/fit_nerf.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/fit_pointcloud.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/raytrace_volume.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/refine_pose.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/render_mesh.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/render_mesh_lit.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/train_gaussian_splatting.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/train_nerf.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/examples/train_ngp_nerf.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cameras/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cameras/cameras.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cli/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cli/compact.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/cli/eval.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/datasets/blender.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/datasets/images.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/datasets/instant_ngp.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/io/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/io/gltf_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/io/image_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/io/obj_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/io/ply_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/chamfer.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/image_metrics.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/lpips.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/mesh_losses.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/losses/point_mesh.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/accel.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/fused_mlp.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/hashgrid.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/instant_ngp.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/nn/occupancy.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/ball_query.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/geometry.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/knn.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/ray_mesh.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/sample_points.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/ops/subdivide.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/points.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/protocols.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/rasterizer.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/rays.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/renderer/shading.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/model.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/projection.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/rasterize.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/reference.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/render.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/sh.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/splatting/tiles.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/structures/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/structures/meshes.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/structures/pointclouds.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/transforms/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/transforms/rotations.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/transforms/se3.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/utils/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/utils/primitives.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/viewer/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/src/mlx3d/viewer/viewer.html +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/__init__.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/conftest.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_behavior.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_cameras.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_cli_compact.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_cli_eval.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_cli_render.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_datasets.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_image_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_import.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_io.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_mesh_rendering.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_ops_losses.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_rasterizer.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_se3.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_smoke.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_structures.py +0 -0
- {mlx3d-0.2.0 → mlx3d-0.3.0}/tests/test_transforms.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## What does this PR do?
|
|
2
|
+
|
|
3
|
+
<!-- A short description of the change and the motivation for it. -->
|
|
4
|
+
|
|
5
|
+
## Related issues
|
|
6
|
+
|
|
7
|
+
<!-- e.g. Fixes #123 -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] Tests pass locally (`uv run pytest tests/`)
|
|
12
|
+
- [ ] Lint/format are clean (`uvx ruff check .` and `uvx ruff format .`)
|
|
13
|
+
- [ ] New behavior is covered by tests
|
|
14
|
+
- [ ] Docs / `CHANGELOG.md` updated (for user-facing changes)
|
|
15
|
+
|
|
16
|
+
## Notes for the reviewer
|
|
17
|
+
|
|
18
|
+
<!-- Anything that needs extra attention: perf numbers, screenshots/renders,
|
|
19
|
+
convention subtleties, follow-ups. -->
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
# Push a version tag to cut a release. The package version is derived from the
|
|
4
|
+
# tag by hatch-vcs (v0.3.0 -> 0.3.0), so nothing is hand-edited:
|
|
5
|
+
#
|
|
6
|
+
# git tag v0.3.0 && git push origin v0.3.0
|
|
7
|
+
#
|
|
8
|
+
# That builds the sdist/wheel, publishes to PyPI (trusted publishing, no
|
|
9
|
+
# token), and opens a GitHub Release with autogenerated notes.
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
tags:
|
|
13
|
+
# Semver with an optional pre-release suffix, e.g. v0.3.0 or v0.3.0rc1.
|
|
14
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
15
|
+
- "v[0-9]+.[0-9]+.[0-9]+[a-z]*[0-9]*"
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
name: Build distributions
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
with:
|
|
27
|
+
# hatch-vcs needs full history and tags to resolve the version.
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
|
|
30
|
+
- name: Verify the tag is on main
|
|
31
|
+
run: |
|
|
32
|
+
git fetch origin main --tags --force
|
|
33
|
+
tag_commit="$(git rev-parse "${GITHUB_REF_NAME}^{commit}")"
|
|
34
|
+
if ! git merge-base --is-ancestor "$tag_commit" origin/main; then
|
|
35
|
+
echo "::error::Tag ${GITHUB_REF_NAME} is not an ancestor of origin/main. Release only from main."
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
- uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
|
|
43
|
+
- name: Build sdist and wheel
|
|
44
|
+
run: |
|
|
45
|
+
python -m pip install --upgrade build
|
|
46
|
+
python -m build
|
|
47
|
+
|
|
48
|
+
- name: Verify built version matches the tag
|
|
49
|
+
run: |
|
|
50
|
+
expected="${GITHUB_REF_NAME#v}"
|
|
51
|
+
if [ ! -f "dist/mlx3d-${expected}-py3-none-any.whl" ]; then
|
|
52
|
+
echo "::error::Expected dist/mlx3d-${expected}-py3-none-any.whl but built:"
|
|
53
|
+
ls -1 dist/
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
echo "Built mlx3d ${expected} from tag ${GITHUB_REF_NAME}."
|
|
57
|
+
|
|
58
|
+
- uses: actions/upload-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: dist
|
|
61
|
+
path: dist/
|
|
62
|
+
|
|
63
|
+
publish-pypi:
|
|
64
|
+
name: Publish to PyPI
|
|
65
|
+
needs: build
|
|
66
|
+
runs-on: ubuntu-latest
|
|
67
|
+
environment: pypi
|
|
68
|
+
permissions:
|
|
69
|
+
id-token: write # trusted publishing
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/download-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
name: dist
|
|
74
|
+
path: dist/
|
|
75
|
+
|
|
76
|
+
- name: Publish distributions to PyPI
|
|
77
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
78
|
+
|
|
79
|
+
github-release:
|
|
80
|
+
name: Create GitHub Release
|
|
81
|
+
needs: publish-pypi
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
permissions:
|
|
84
|
+
contents: write # create the release
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
with:
|
|
88
|
+
fetch-depth: 0
|
|
89
|
+
|
|
90
|
+
- uses: actions/download-artifact@v4
|
|
91
|
+
with:
|
|
92
|
+
name: dist
|
|
93
|
+
path: dist/
|
|
94
|
+
|
|
95
|
+
- name: Create release with autogenerated notes
|
|
96
|
+
env:
|
|
97
|
+
GH_TOKEN: ${{ github.token }}
|
|
98
|
+
run: |
|
|
99
|
+
prerelease=""
|
|
100
|
+
case "${GITHUB_REF_NAME}" in
|
|
101
|
+
*a*|*b*|*rc*) prerelease="--prerelease" ;;
|
|
102
|
+
esac
|
|
103
|
+
gh release create "${GITHUB_REF_NAME}" dist/* \
|
|
104
|
+
--title "${GITHUB_REF_NAME}" \
|
|
105
|
+
--generate-notes \
|
|
106
|
+
$prerelease
|
|
@@ -36,7 +36,8 @@ jobs:
|
|
|
36
36
|
python-version: ${{ matrix.python-version }}
|
|
37
37
|
enable-cache: true
|
|
38
38
|
- name: Install
|
|
39
|
-
|
|
39
|
+
# --extra capture pulls OpenCV + SciPy so the built-in SfM tests run.
|
|
40
|
+
run: uv sync --extra capture
|
|
40
41
|
- name: Smoke tests
|
|
41
42
|
run: uv run pytest tests/ -m smoke -v
|
|
42
43
|
- name: Unit + data tests
|
mlx3d-0.3.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Fast forward-only Gaussian rasterization (`FastGaussianRenderer`,
|
|
8
|
+
`render_gaussians_fast`), adapting the geometry-shader-style pipeline of
|
|
9
|
+
dendenxu/fast-gaussian-rasterization to Metal compute: a fused per-Gaussian
|
|
10
|
+
geometry kernel, duplicates emitted in globally depth-sorted order (stable
|
|
11
|
+
32-bit tile sort), boundary-detection tile ranges, fp16 splat colors, and
|
|
12
|
+
zero mid-frame CPU/GPU synchronization via persistent grow-on-demand
|
|
13
|
+
buffers. 1.5–2× faster than the training rasterizer on real scenes (up to
|
|
14
|
+
3.7× at high pixel-to-point ratios) at 45+ dB PSNR parity; not
|
|
15
|
+
differentiable (training keeps `render_gaussians`). Exposed as
|
|
16
|
+
`mlx3d-view --fast` and `mlx3d-render --fast`.
|
|
17
|
+
- Dynamic (4D) Gaussian sequence playback: `FastGaussianRenderer.update()`
|
|
18
|
+
swaps per-timestep arrays cheaply;
|
|
19
|
+
`examples/play_dynamic_gaussians.py` streams a Dynamic 3D Gaussians
|
|
20
|
+
`params.npz` at 67 fps (vs 40 fps on the training path) with GIF/frame
|
|
21
|
+
export. New `examples/benchmark_fast_rasterization.py` reports
|
|
22
|
+
latency/FPS/PSNR on synthetic scenes or any 3DGS `.ply`.
|
|
23
|
+
- `mlx3d-capture`: a one-command capture pipeline (photos directory or video
|
|
24
|
+
file → camera poses → 3D Gaussian Splatting with a live browser viewer → a
|
|
25
|
+
compacted `splat.ply`). Stages are cached and resumable; `--quality
|
|
26
|
+
fast/balanced/best` presets pick iterations, resolution, frame count and SH
|
|
27
|
+
degree. Python API in `mlx3d.capture` (`run_capture`, `CaptureConfig`).
|
|
28
|
+
- Built-in COLMAP-free structure-from-motion (`mlx3d.capture.run_sfm`): SIFT +
|
|
29
|
+
ratio matching, essential-matrix initialization, incremental PnP-RANSAC
|
|
30
|
+
registration, filtered triangulation, and periodic sparse bundle adjustment
|
|
31
|
+
with shared-focal refinement (EXIF 35mm-equivalent prior when available).
|
|
32
|
+
Requires the new optional `[capture]` extra (OpenCV + SciPy). A thin COLMAP
|
|
33
|
+
CLI wrapper (`mlx3d.capture.run_colmap`) is preferred automatically when the
|
|
34
|
+
binary is installed.
|
|
35
|
+
- Video ingestion for captures: ffmpeg-based even sampling with automatic
|
|
36
|
+
motion-blur filtering (sharpest frame per time bucket by variance of
|
|
37
|
+
Laplacian).
|
|
38
|
+
- `GaussianTrainer.step` accepts an optional per-view SE(3) twist and returns
|
|
39
|
+
its gradient, enabling BARF-style joint pose refinement during training. The
|
|
40
|
+
capture pipeline turns this on automatically for built-in SfM poses and
|
|
41
|
+
exports the refined poses as a COLMAP model.
|
|
42
|
+
- `save_colmap`: binary COLMAP sparse-model writer (inverse of `load_colmap`),
|
|
43
|
+
with intrinsics deduplication and PINHOLE/OPENCV/OPENCV_FISHEYE support.
|
|
44
|
+
|
|
45
|
+
## 0.2.1
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- SDF utilities in `mlx3d.ops`: analytic primitives (`sdf_sphere`, `sdf_box`,
|
|
50
|
+
`sdf_torus`, `sdf_plane`), constructive-solid-geometry operators
|
|
51
|
+
(`sdf_union`, `sdf_intersection`, `sdf_difference` and smooth `sdf_smooth_*`
|
|
52
|
+
variants), and `sample_sdf_grid` / `sdf_to_mesh` to turn an SDF callable into
|
|
53
|
+
a mesh via marching cubes. All pure-MLX and differentiable w.r.t. shape
|
|
54
|
+
parameters. New `examples/sdf_csg.py` shows CSG modeling through to a render.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- NeRF training: the classic `NeRF` model used a ReLU density activation that
|
|
59
|
+
dies at initialization (density 0 everywhere, zero gradients), so the network
|
|
60
|
+
never trained. Switched to softplus; added a regression test.
|
|
61
|
+
- Soft mesh rasterizer (`render_mesh_soft`): per-chunk accumulators are now
|
|
62
|
+
evaluated each iteration so intermediates are freed between chunks. Peak
|
|
63
|
+
memory for dense meshes is bounded (a 46k-face mesh at 256² went from OOM on
|
|
64
|
+
16 GB to ~1.2 GB) while staying fully differentiable.
|
|
65
|
+
- `marching_cubes` now welds duplicate crossing-point vertices (≈5× fewer verts
|
|
66
|
+
on a 64³ grid) and drops collapsed faces, cutting downstream memory and cost.
|
|
67
|
+
- `examples/extract_mesh.py` visualizes dense meshes with the O(H·W) hard
|
|
68
|
+
rasterizer instead of the soft renderer (68 s + OOM → ~0.4 s).
|
|
69
|
+
|
|
70
|
+
### Packaging
|
|
71
|
+
|
|
72
|
+
- Added a standard `project.optional-dependencies` `dev` extra so
|
|
73
|
+
`pip install -e ".[dev]"` works with any installer (the PEP 735
|
|
74
|
+
`dependency-groups` entry is kept for `uv sync`). Documented both dev setups,
|
|
75
|
+
including the uv-venv `pip` caveat, in the README.
|
|
76
|
+
|
|
77
|
+
## 0.2.0
|
|
78
|
+
|
|
79
|
+
Release branch in progress.
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- Arbitrary-channel Gaussian feature rendering through the existing Metal
|
|
84
|
+
rasterizer, with alpha-composited and normalized expected-feature modes.
|
|
85
|
+
- Mip-Splatting-style opacity compensation for anti-aliased Gaussian rendering,
|
|
86
|
+
available from render APIs and Gaussian Splatting training.
|
|
87
|
+
- glTF scene loading across default-scene nodes and triangle primitives,
|
|
88
|
+
including node transforms, UVs, material IDs, and PBR base-color summaries.
|
|
89
|
+
- glTF base-color texture loading for embedded/data-URI and external image
|
|
90
|
+
assets, wired into `mlx3d-render` for textured mesh previews.
|
|
91
|
+
- glTF metallic/roughness factor import, with `mlx3d-render --shading pbr`
|
|
92
|
+
forwarding uniform material factors into the PBR mesh shader.
|
|
93
|
+
- glTF export of self-contained GLB assets with embedded base-color PNG
|
|
94
|
+
textures.
|
|
95
|
+
- glTF export of UV coordinates and a simple PBR base color material.
|
|
96
|
+
- `mlx3d-render` CLI for rendering Gaussian checkpoints and mesh assets to
|
|
97
|
+
RGB, depth, or normal images.
|
|
98
|
+
- `mlx3d-eval` CLI for deterministic Gaussian checkpoint evaluation with PSNR,
|
|
99
|
+
SSIM, L1, per-view metrics, and JSON output.
|
|
100
|
+
- Gaussian checkpoint compaction by opacity/footprint importance, Gaussian
|
|
101
|
+
count cap, and optional spherical-harmonic degree truncation.
|
|
102
|
+
- `mlx3d-compact` CLI for checkpoint pruning and SH-degree truncation.
|
|
103
|
+
- Opt-in 2DGS depth-variance and normal-depth consistency regularizers that
|
|
104
|
+
reuse the differentiable Metal-backed feature rasterizer.
|
|
105
|
+
- 2DGS surfel extraction helpers on `GaussianModel`, including a Poisson
|
|
106
|
+
reconstruction wrapper for mesh extraction from oriented Gaussian disks.
|
|
107
|
+
- 3DGUT-style Unscented Transform Gaussian projection for distortion-aware
|
|
108
|
+
rendering/training with `projection="ut"` and `--projection ut`.
|
|
109
|
+
- PBR-style Cook-Torrance/GGX mesh shading with roughness and metallic controls.
|
|
110
|
+
- Morton-order face sorting for ray-mesh intersection, improving chunk-level
|
|
111
|
+
AABB culling on arbitrarily ordered meshes while preserving original face IDs.
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- Aligned Gaussian depth rasterization with the RGB kernel's early-transmittance
|
|
116
|
+
cutoff semantics.
|
mlx3d-0.3.0/CITATION.cff
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use MLX3D in your research, please cite it as below."
|
|
3
|
+
title: "MLX3D: Differentiable 3D computer vision on Apple Silicon"
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- family-names: "Razlighi"
|
|
7
|
+
given-names: "AmirHossein"
|
|
8
|
+
email: arazlighi@gmail.com
|
|
9
|
+
repository-code: "https://github.com/amirhossein-razlighi/mlx3D"
|
|
10
|
+
url: "https://amirhossein-razlighi.github.io/mlx3D/"
|
|
11
|
+
license: MIT
|
|
12
|
+
keywords:
|
|
13
|
+
- MLX
|
|
14
|
+
- Apple Silicon
|
|
15
|
+
- differentiable rendering
|
|
16
|
+
- gaussian splatting
|
|
17
|
+
- NeRF
|
|
18
|
+
- computer vision
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
+
identity and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
+
community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or advances
|
|
31
|
+
of any kind
|
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
- Public or private harassment
|
|
34
|
+
- Publishing others' private information, such as a physical or email address,
|
|
35
|
+
without their explicit permission
|
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
|
|
56
|
+
## Enforcement
|
|
57
|
+
|
|
58
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
59
|
+
reported to the community leaders responsible for enforcement at
|
|
60
|
+
<arazlighi@gmail.com>. All complaints will be reviewed and investigated promptly
|
|
61
|
+
and fairly.
|
|
62
|
+
|
|
63
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
64
|
+
reporter of any incident.
|
|
65
|
+
|
|
66
|
+
## Attribution
|
|
67
|
+
|
|
68
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
69
|
+
version 2.1, available at
|
|
70
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
71
|
+
|
|
72
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
73
|
+
[https://www.contributor-covenant.org/faq][FAQ].
|
|
74
|
+
|
|
75
|
+
[homepage]: https://www.contributor-covenant.org
|
|
76
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
77
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Contributing to MLX3D
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving MLX3D! Bug reports, feature requests,
|
|
4
|
+
docs fixes and pull requests are all welcome.
|
|
5
|
+
|
|
6
|
+
## Getting set up
|
|
7
|
+
|
|
8
|
+
You need an Apple Silicon Mac (MLX runs on the Metal GPU) and Python ≥ 3.10.
|
|
9
|
+
Development uses [uv](https://docs.astral.sh/uv/):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git clone https://github.com/amirhossein-razlighi/mlx3D
|
|
13
|
+
cd mlx3D
|
|
14
|
+
uv sync --extra capture # .venv with dev tools + the optional SfM deps
|
|
15
|
+
uv run pytest tests/
|
|
16
|
+
uv run mkdocs serve # docs at http://127.0.0.1:8000
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Plain pip works too: `pip install -e ".[dev,capture]"`.
|
|
20
|
+
|
|
21
|
+
## Before you open a PR
|
|
22
|
+
|
|
23
|
+
1. **Run the tests.** `uv run pytest tests/` must pass. Tests are grouped by
|
|
24
|
+
marker (`smoke`, `unit`, `data`, `behavior`) — CI runs them all on Apple
|
|
25
|
+
Silicon runners.
|
|
26
|
+
2. **Lint and format.** CI enforces both:
|
|
27
|
+
```bash
|
|
28
|
+
uvx ruff check .
|
|
29
|
+
uvx ruff format .
|
|
30
|
+
```
|
|
31
|
+
3. **Add tests** for new behavior. Dataset/IO code is tested against small
|
|
32
|
+
synthetic fixtures generated in-process (see `tests/test_capture.py` for
|
|
33
|
+
examples) — no downloads in tests.
|
|
34
|
+
4. **Update the docs** when you change user-facing behavior: the relevant
|
|
35
|
+
tutorial under `docs/`, the API reference stub if you add a module, and a
|
|
36
|
+
`CHANGELOG.md` entry under `Unreleased`.
|
|
37
|
+
|
|
38
|
+
## Guidelines
|
|
39
|
+
|
|
40
|
+
- **Conventions matter.** MLX3D uses the OpenCV/COLMAP camera convention
|
|
41
|
+
everywhere (`X_cam = R @ X_world + t`, `+z` forward); see
|
|
42
|
+
[docs/conventions.md](docs/conventions.md) before touching cameras,
|
|
43
|
+
projection, or dataset loaders.
|
|
44
|
+
- **Keep the public API small and composable.** Renderers are plain callables
|
|
45
|
+
`(camera, scene) -> {"image", ...}`; prefer functions and dataclass configs
|
|
46
|
+
over deep class hierarchies.
|
|
47
|
+
- **Heavy dependencies stay optional.** Core `mlx3d` depends only on MLX,
|
|
48
|
+
NumPy, Pillow and tqdm; anything heavier (OpenCV, SciPy, ...) belongs in an
|
|
49
|
+
optional extra with a helpful `ImportError` message.
|
|
50
|
+
- **Performance-sensitive code** (Metal kernels, training loops) should come
|
|
51
|
+
with a before/after measurement in the PR description.
|
|
52
|
+
|
|
53
|
+
## Releasing (maintainers)
|
|
54
|
+
|
|
55
|
+
The package version is **derived from the git tag** by
|
|
56
|
+
[hatch-vcs](https://github.com/ophidian-labs/hatch-vcs) — it is never written
|
|
57
|
+
by hand in `pyproject.toml`, `__init__.py`, or anywhere else. To cut a release:
|
|
58
|
+
|
|
59
|
+
1. Land everything on `main` and move the `CHANGELOG.md` `Unreleased` items
|
|
60
|
+
under a new dated version heading.
|
|
61
|
+
2. Tag and push:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
git tag v0.3.0 # must be vMAJOR.MINOR.PATCH (rc/a/b suffixes allowed)
|
|
65
|
+
git push origin v0.3.0
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
That's it. The `publish` workflow then builds the sdist/wheel (stamped
|
|
69
|
+
`0.3.0`), verifies the version matches the tag and that the tag is on `main`,
|
|
70
|
+
publishes to PyPI via trusted publishing (no API token), and opens a GitHub
|
|
71
|
+
Release with autogenerated notes. Between tags, local builds get a dev version
|
|
72
|
+
like `0.3.0.dev4+g1a2b3c4`.
|
|
73
|
+
|
|
74
|
+
## Reporting bugs
|
|
75
|
+
|
|
76
|
+
Use the issue templates. The most useful reports include: macOS + chip model,
|
|
77
|
+
Python and `mlx`/`mlx3d` versions, and a minimal script that reproduces the
|
|
78
|
+
problem.
|
|
79
|
+
|
|
80
|
+
## Code of conduct
|
|
81
|
+
|
|
82
|
+
This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md). Be kind.
|
mlx3d-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AmirHossein Razlighi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mlx3d
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Differentiable 3D computer vision on Apple Silicon, built on MLX
|
|
5
5
|
Project-URL: Homepage, https://github.com/amirhossein-razlighi/mlx3D
|
|
6
6
|
Project-URL: Documentation, https://amirhossein-razlighi.github.io/mlx3D/
|
|
@@ -25,6 +25,14 @@ Requires-Dist: mlx>=0.31.0; platform_system == 'Darwin' and platform_machine ==
|
|
|
25
25
|
Requires-Dist: numpy>=1.24
|
|
26
26
|
Requires-Dist: pillow>=10.0
|
|
27
27
|
Requires-Dist: tqdm>=4.66
|
|
28
|
+
Provides-Extra: capture
|
|
29
|
+
Requires-Dist: opencv-python>=4.8; extra == 'capture'
|
|
30
|
+
Requires-Dist: scipy>=1.11; extra == 'capture'
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
|
|
33
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
28
36
|
Description-Content-Type: text/markdown
|
|
29
37
|
|
|
30
38
|
<p align="center">
|
|
@@ -33,6 +41,14 @@ Description-Content-Type: text/markdown
|
|
|
33
41
|
|
|
34
42
|
# MLX3D
|
|
35
43
|
|
|
44
|
+
<p align="center">
|
|
45
|
+
<a href="https://pypi.org/project/mlx3d/"><img alt="PyPI" src="https://img.shields.io/pypi/v/mlx3d.svg?color=6f42c1"></a>
|
|
46
|
+
<a href="https://pypi.org/project/mlx3d/"><img alt="Python" src="https://img.shields.io/pypi/pyversions/mlx3d.svg"></a>
|
|
47
|
+
<a href="https://github.com/amirhossein-razlighi/mlx3D/actions/workflows/tests.yml"><img alt="Tests" src="https://github.com/amirhossein-razlighi/mlx3D/actions/workflows/tests.yml/badge.svg"></a>
|
|
48
|
+
<a href="https://amirhossein-razlighi.github.io/mlx3D/"><img alt="Docs" src="https://img.shields.io/badge/docs-mkdocs-blue"></a>
|
|
49
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green.svg"></a>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
36
52
|
**Differentiable 3D computer vision on Apple Silicon, built on [MLX](https://github.com/ml-explore/mlx).**
|
|
37
53
|
|
|
38
54
|
MLX3D brings the PyTorch3D workflow to Macs: batched 3D data structures, cameras, differentiable rendering, and modern view synthesis — NeRF and **3D Gaussian Splatting with custom Metal kernels** — running natively on the Apple GPU.
|
|
@@ -47,6 +63,8 @@ MLX3D brings the PyTorch3D workflow to Macs: batched 3D data structures, cameras
|
|
|
47
63
|
- **NeRF** — positional encoding, the NeRF MLP, stratified + hierarchical sampling, volume rendering, Blender-synthetic dataset loader.
|
|
48
64
|
- **Mesh rendering** — differentiable soft triangle rasterization, UV texture sampling for OBJ/MTL assets, and scalar-field mesh extraction.
|
|
49
65
|
- **Gaussian Splatting** — a Metal translation of the reference CUDA rasterizer (tile-based forward & backward kernels wrapped in `mx.custom_function`), EWA projection, spherical harmonics, anti-aliased and arbitrary feature rendering, adaptive density control, COLMAP loading, and standard 3DGS `.ply` checkpoints. ~30 FPS forward at 720p with 100k Gaussians on an M-series GPU.
|
|
66
|
+
- **Capture pipeline** — `mlx3d-capture photos_or_video` goes from raw photos or a phone video to a trained splat in one resumable command: sharp-frame selection, COLMAP or built-in COLMAP-free SfM (with joint pose refinement during training), live training preview, and a compacted `.ply` export.
|
|
67
|
+
- **Fast splat viewing** — a forward-only rasterization path (`FastGaussianRenderer`, `mlx3d-view --fast`) with fused Metal geometry kernels, cross-frame caching, and sync-free frames: 1.5–2× faster than the training rasterizer on real scenes (up to 3.7× for large splats) at 45+ dB parity, and 67 fps playback of dynamic **4D Gaussian** sequences.
|
|
50
68
|
- **Interactive viewer** — `mlx3d-view point_cloud.ply` opens a browser viewer with orbit/pan/zoom; frames are rendered on the Apple GPU by the Metal rasterizer and streamed live. Works for NeRFs too.
|
|
51
69
|
- **IO** — OBJ and PLY (ascii + binary, including Gaussian Splatting checkpoint layouts), plus one-line image `save_image` / `load_image` for any renderer output.
|
|
52
70
|
- **Composable & extensible** — every image renderer is a plain callable `(camera, scene) -> {"image", "alpha", "depth"}` (the [`Renderer`](src/mlx3d/renderer/protocols.py) protocol), so you can drop in your own rasterizer, shader, or ray tracer and reuse the rest of the pipeline — no base classes to subclass.
|
|
@@ -59,6 +77,37 @@ pip install mlx3d
|
|
|
59
77
|
|
|
60
78
|
Requires an Apple Silicon Mac and Python ≥ 3.10.
|
|
61
79
|
|
|
80
|
+
## Photos → splat in minutes
|
|
81
|
+
|
|
82
|
+
Turn a folder of photos — or a phone video — into a trained 3D Gaussian Splat
|
|
83
|
+
with one command, entirely on your Mac:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
mlx3d-capture ./my_photos/ # or: mlx3d-capture walkaround.mp4
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
<p align="center">
|
|
90
|
+
<img src="./docs/assets/capture_castle.jpg" width="90%" alt="Left: one of 11 input photos. Right: the trained 3D Gaussian Splat rendered from the same viewpoint." />
|
|
91
|
+
<br/>
|
|
92
|
+
<em>11 photos in, splat out — input photo (left) vs. the trained splat (right), poses from the built-in COLMAP-free SfM, ~5 minutes on an M-series laptop.</em>
|
|
93
|
+
</p>
|
|
94
|
+
|
|
95
|
+
This runs the whole pipeline: frame extraction (with automatic motion-blur
|
|
96
|
+
filtering for video) → camera poses → 3DGS training with a **live browser
|
|
97
|
+
viewer** → a compacted `splat.ply` you can open in any splat viewer. Poses
|
|
98
|
+
come from COLMAP when it's installed (`brew install colmap`); otherwise
|
|
99
|
+
mlx3d's **built-in COLMAP-free SfM** (`pip install "mlx3d[capture]"`) handles
|
|
100
|
+
them and the trainer refines poses jointly with the splats. Stages are cached,
|
|
101
|
+
so re-runs resume where they left off.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
mlx3d-capture clip.mp4 --quality fast # quick preview
|
|
105
|
+
mlx3d-capture ./my_photos/ --quality best # 30k iterations, full resolution
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
See the [capture tutorial](https://amirhossein-razlighi.github.io/mlx3D/tutorials/capture/)
|
|
109
|
+
for capture tips and every option.
|
|
110
|
+
|
|
62
111
|
## Quick example
|
|
63
112
|
|
|
64
113
|
```python
|
|
@@ -79,14 +128,56 @@ Train Gaussian Splatting on any COLMAP scene (same inputs as the original 3DGS):
|
|
|
79
128
|
|
|
80
129
|
```bash
|
|
81
130
|
python examples/train_gaussian_splatting.py --data /path/to/scene --iters 7000
|
|
82
|
-
mlx3d-view outputs/gs/point_cloud.ply #
|
|
131
|
+
mlx3d-view outputs/gs/point_cloud.ply --fast # interactive viewer (forward-only fast rasterizer)
|
|
83
132
|
mlx3d-render outputs/gs/point_cloud.ply --out render.png --antialias
|
|
84
133
|
mlx3d-eval outputs/gs/point_cloud.ply --data /path/to/scene --views 20 --json-out metrics.json
|
|
85
134
|
mlx3d-compact outputs/gs/point_cloud.ply --out point_cloud_small.ply --max-gaussians 500000
|
|
86
135
|
```
|
|
87
136
|
|
|
137
|
+
For viewing-only workloads (viewers, flythroughs, 4D playback), the
|
|
138
|
+
[fast rasterization path](https://amirhossein-razlighi.github.io/mlx3D/tutorials/fast_rendering/)
|
|
139
|
+
renders the same checkpoints 1.5–2× faster at 45+ dB parity:
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
from mlx3d.splatting import FastGaussianRenderer
|
|
143
|
+
|
|
144
|
+
renderer = FastGaussianRenderer(model) # caches activations, covariances, SH colors
|
|
145
|
+
out = renderer.render(camera) # forward-only: {"image", "alpha"}
|
|
146
|
+
```
|
|
147
|
+
|
|
88
148
|
More in the docs: [mesh optimization](https://amirhossein-razlighi.github.io/mlx3D/tutorials/mesh_optimization/), [point cloud fitting](https://amirhossein-razlighi.github.io/mlx3D/tutorials/pointcloud_fitting/), [NeRF](https://amirhossein-razlighi.github.io/mlx3D/tutorials/nerf/), [Gaussian Splatting](https://amirhossein-razlighi.github.io/mlx3D/tutorials/gaussian_splatting/).
|
|
89
149
|
|
|
150
|
+
## Gallery
|
|
151
|
+
|
|
152
|
+
<table>
|
|
153
|
+
<tr>
|
|
154
|
+
<td align="center" width="50%">
|
|
155
|
+
<img src="./docs/assets/v020_truck_render_hi.png" alt="3D Gaussian Splatting render of the Tanks & Temples truck scene" /><br/>
|
|
156
|
+
<em>3D Gaussian Splatting (Tanks & Temples truck), Metal rasterizer</em>
|
|
157
|
+
</td>
|
|
158
|
+
<td align="center" width="50%">
|
|
159
|
+
<img src="./docs/assets/v020_truck_normals_hi.png" alt="Rendered normals of the truck scene" /><br/>
|
|
160
|
+
<em>The same splat rendered as normals — any per-Gaussian feature works</em>
|
|
161
|
+
</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<td align="center" width="50%">
|
|
165
|
+
<img src="./docs/assets/v020_lego_ngp.png" alt="Hash-grid NeRF render of the Lego scene" /><br/>
|
|
166
|
+
<em>Instant-NGP-style hash-grid NeRF (Blender Lego)</em>
|
|
167
|
+
</td>
|
|
168
|
+
<td align="center" width="50%">
|
|
169
|
+
<img src="./docs/assets/render_lit_sphere.png" alt="Lit mesh render" /><br/>
|
|
170
|
+
<em>Differentiable mesh rendering with Phong shading</em>
|
|
171
|
+
</td>
|
|
172
|
+
</tr>
|
|
173
|
+
<tr>
|
|
174
|
+
<td align="center" colspan="2">
|
|
175
|
+
<img src="./docs/assets/fast_4dgs_juggle_strip.png" alt="Dynamic 4D Gaussian sequence played back with the fast rasterizer" /><br/>
|
|
176
|
+
<em>Dynamic <b>4D Gaussians</b> (336k splats × 150 timesteps) played back at 67 fps by the forward-only fast rasterizer</em>
|
|
177
|
+
</td>
|
|
178
|
+
</tr>
|
|
179
|
+
</table>
|
|
180
|
+
|
|
90
181
|
## Examples
|
|
91
182
|
|
|
92
183
|
The [`examples/`](examples/) folder has runnable scripts for every core feature.
|
|
@@ -119,29 +210,21 @@ uv run pytest tests/
|
|
|
119
210
|
uv run mkdocs serve # docs at http://127.0.0.1:8000
|
|
120
211
|
```
|
|
121
212
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- [x] 2DGS / surfel-style Gaussian mode with local-normal thickness constraints
|
|
138
|
-
- [x] 2DGS geometry losses and surfel surface extraction helpers
|
|
139
|
-
- [x] Mip-Splatting-style anti-aliasing / opacity compensation
|
|
140
|
-
- [x] Additional well-known splatting recipes (compression, 3DGUT-style variants)
|
|
141
|
-
- [x] Viewer depth-map mode for Gaussian checkpoints
|
|
142
|
-
- [x] Viewer mesh-style inspection with GPU-efficient depth contours
|
|
143
|
-
- [x] Marching cubes / mesh extraction
|
|
144
|
-
- [x] More acceleration structures (hash-grid encodings for NeRF)
|
|
213
|
+
Prefer plain pip? The package installs editable with the standard dev extra:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
python -m venv .venv && source .venv/bin/activate
|
|
217
|
+
pip install -e ".[dev]"
|
|
218
|
+
pytest
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> [!NOTE]
|
|
222
|
+
> `uv`-created `.venv`s do not ship their own `pip`. Inside one, use
|
|
223
|
+
> `uv pip ...` (or `uv run ...`); a bare `pip` may resolve to a different
|
|
224
|
+
> Python and silently install into the wrong environment.
|
|
225
|
+
|
|
226
|
+
Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md) for the
|
|
227
|
+
workflow and guidelines, or file an issue to get started.
|
|
145
228
|
|
|
146
229
|
## License
|
|
147
230
|
|