Skip to main content

Official SMART pipeline for tight 3D bounding boxes

Project description

SMART: Split, Merge, and Refine

Official implementation of Split, Merge, and Refine: Fitting Tight Bounding Boxes via Over-Segmentation and Iterative Search, 3DV 2024.

SMART teaser

Paper | arXiv | Quickstart | Pipeline | Package Docs | All Docs

Chanhyeok Park and Minhyuk Sung

SMART fits a compact set of tight 3D bounding boxes to a mesh without human supervision. The package uses a Python CLI/API with a native C++ SMART core and the fixed vendored Manifold backend.

Highlights

  • Paper-style pipeline: normalize mesh, tetrahedralize, pre-segment, merge, refine, run MCTS, render, and evaluate.
  • Native C++ backend for the SMART core through smart._cpp and smart-cpp-native.
  • Fixed vendored Manifold source is kept unchanged for exact geometry operations.
  • Python API and CLI for reproducible experiments and package use.
  • ShapeNet airplane/chair/table reproduction configs are included.

Installation

Install the package:

python -m pip install "smart-bbox[pipeline]"

Install from source:

git clone https://github.com/chpark1111/SMART.git
cd SMART
python -m pip install -e ".[pipeline]"

Verify the install:

smart --config configs/smoke_5.yaml doctor
smart-cpp-native --help

For the complete install and reproduction path, see docs/QUICKSTART.md.

Documentation

Main user docs:

  • Quickstart: install, verify, prepare tools/data, and run a small reproduction.
  • Pipeline: stage order, config control, rendering, failure handling, and parameter overrides.
  • Python Package: CLI, Python API, native executable, packaged configs, and library usage.
  • Tetra Failure Playbook: why Mesh2Tet/fTetWild fails, how SMART records failures, and which repair knobs to try.
  • Repository Structure: public release layout versus ignored local data, runs, external tools, and experiments.

Maintainer and research docs:

  • Release Guide: local release preflight, wheel checks, tags, and PyPI publishing.
  • Release Notes 0.1.0: current release scope and verification notes.
  • Research Plan: RL/deep learning priors, MCTS upgrade, memory/table-based search, and promotion rules.

Local Example

If this checkout already has local ShapeNet meshes under data/, create a 3-per-category example set and run it:

bash examples/prepare_sample_shapes.sh
bash examples/run_example_3x3.sh

The example meshes are copied to examples/sample_shapes/, which is ignored by git and excluded from packages.

Data

SMART expects ShapeNet-style mesh folders:

data/shapenet_airplane/<model_id>/model.obj
data/shapenet_chair/<model_id>/model.obj
data/shapenet_table/<model_id>/model.obj

Paper category synsets:

airplane  02691156
chair     03001627
table     04379243

Prepare zipped category archives:

python scripts/prepare_shapenet_samples.py \
  --archive-dir /path/to/shapenet_zips \
  --output-root data/expanded \
  --categories airplane chair table \
  --limit 100000 \
  --normalize preserve

SMART writes normalized meshes under runs/<profile>/normalized/; it does not modify the downloaded meshes in data/.

Build External Tools

Full reproduction from raw meshes requires Mesh2Tet tools, CoACD, and the fixed Manifold runtime. In a source checkout:

smart --config configs/smoke_5.yaml build-tools

After installing from a wheel, run the same setup in a writable project/cache directory:

export SMART_TOOLS_ROOT="$PWD/.smart-tools"
smart --config smoke_5.yaml build-tools

pip install installs the SMART Python package and the bundled native SMART C++ extension/executable from wheels. It intentionally does not clone and compile Mesh2Tet/fTetWild/ManifoldPlus during installation. Those external builds are large, platform-specific, and can require local compiler/system packages, so SMART exposes them as an explicit smart build-tools step instead. That one command prepares ManifoldPlus, fTetWild, the CoACD Python CLI runtime, the fixed Manifold runtime, and the local smart._cpp/ smart-cpp-native build for a source checkout. It is idempotent: if CoACD already probes successfully, SMART skips the slow editable install; if source editable installation fails, SMART tries the PyPI CoACD runtime and only fails the command when no working coacd CLI is found.

Use smart --config configs/smoke_5.yaml build-cpp only when you need to rebuild the SMART C++ extension/executable without rebuilding external tools.

Prebuilt binaries can also be supplied:

export SMART_MANIFOLDPLUS_BIN=/path/to/ManifoldPlus/build/manifold
export SMART_FTETWILD_BIN=/path/to/fTetWild/build/FloatTetwild_bin
export SMART_COACD_BIN=/path/to/coacd
export SMART_MANIFOLD_PYTHON=/path/to/smart/vendor/manifold/build/bindings/python

Tetrahedralization Failures

Mesh2Tet can fail on noisy ShapeNet meshes because the input OBJ may be non-watertight, self-intersecting, degenerate, or split into awkward components. SMART handles this per mesh, not as a fatal dataset error:

  • logs each ManifoldPlus/fTetWild attempt under runs/<profile>/logs/tetra/;
  • retries with finer settings, coarser settings, --coarsen, and robust winding number settings;
  • validates that tetra.msh and tetra.msh__sf.obj exist and are usable;
  • records failed attempts in the tetra manifest, then skips downstream stages for that mesh while continuing the rest of the dataset.

Before tetrahedralization, SMART runs conservative mesh cleanup. The tetra stage also classifies failures and queues targeted repair retries automatically:

Detected failure Likely cause Automatic SMART response
surface is not watertight holes or open mesh boundaries retry with a temporary fill_holes=true repaired input
fTetWild/ManifoldPlus timeout or crash self-intersection, very thin parts, degenerate faces, non-manifold edges retry with conservative repaired input and robust/coarser parameter attempts
tetra element count below minimum tetra parameters too fine/coarse or damaged repair output keep fine/coarse retry schedule and record the failed parameters
disconnected components true multi-part shape or small detached fragments only use keep_largest_component=true if explicitly enabled, because it can delete real parts

Repaired inputs are written under runs/<profile>/logs/tetra/...; SMART never mutates the original data/ OBJ. More destructive rescue, such as keep_largest_component=true, is available in config but is off by default because it can remove real disconnected shape parts. A failed mesh is therefore usually recoverable by either enabling a stronger repair variant or loosening/coarsening the tetra parameters, but SMART will not silently corrupt the shape just to force success.

See docs/TETRA_FAILURE_PLAYBOOK.md for debug commands and stronger repair options.

Run SMART

Smoke run through the Python pipeline:

smart --config configs/smoke_5.yaml run
smart --config configs/smoke_5.yaml summary

Run one mesh through the native C++ executable:

smart-cpp-native run-pipeline \
  --input data/shapenet_airplane/<model_id>/model.obj \
  --work_dir runs/native_one/<model_id> \
  --manifoldplus_bin external/mesh2tet/ManifoldPlus/build/manifold \
  --ftetwild_bin external/mesh2tet/fTetWild/build/FloatTetwild_bin \
  --coacd_bin external/CoACD/python/package/bin/coacd \
  --epsilon 0.002 \
  --edge_length 0.1 \
  --refine_max_step 2000 \
  --mcts_iter 3000

Run a native batch:

smart-cpp-native run-batch \
  --data_root data \
  --categories shapenet_airplane,shapenet_chair,shapenet_table \
  --limit_per_category 1 \
  --output_root runs/native_batch \
  --manifoldplus_bin external/mesh2tet/ManifoldPlus/build/manifold \
  --ftetwild_bin external/mesh2tet/fTetWild/build/FloatTetwild_bin \
  --coacd_bin external/CoACD/python/package/bin/coacd \
  --jobs auto \
  --reuse_existing \
  --resume_success

smart-cpp-native batch-summary \
  --manifest runs/native_batch/native_pipeline.jsonl

Evaluate And Render

Evaluate bbox outputs with the paper metrics:

smart --config configs/smoke_5.yaml evaluate

Render final boxes:

smart --config configs/smoke_5.yaml render \
  --set render.transparent=true \
  --set render.joint_mesh=false

The default renderer is the packaged software preview renderer so macOS does not launch Blender during normal runs. The adapted paper Blender renderer is still packaged under smart/legacy/renderer and can be enabled explicitly:

smart --config configs/smoke_5.yaml --set render.backend=blender render

Python API

import smart

cfg = smart.load_config("configs/smoke_5.yaml")
records = smart.run(cfg)
print(records[-1])

Package/API details are in docs/PYTHON_PACKAGE.md.

Repository Layout

smart/        Python package, CLI/API, configs, pipeline wrappers
cpp/          Native C++ SMART core and smart-cpp-native executable
configs/      Source-checkout YAML profiles
examples/     Public shell examples; local sample meshes are ignored
scripts/      Supported data prep, release, and reproduction utilities
tests/        Package/native/release tests
docs/         User docs, paper assets, and release notes
experiments/  Ignored local research configs, scripts, assets, and tests
data/         Local ShapeNet data only; not packaged
runs/         Local outputs only; not packaged
external/     Downloaded Mesh2Tet/CoACD tools; not packaged
past_codes/   Original research archive; reference only

See docs/REPOSITORY_STRUCTURE.md for more detail.

Configs

Recommended public configs:

  • configs/smoke_5.yaml: fast local smoke test.
  • configs/example_3x3.yaml: 3 meshes per paper category from local example data.
  • configs/demo.yaml: small demo profile.
  • configs/paper_like.yaml: paper-style parameters.
  • configs/expanded_full.yaml: larger local ShapeNet layout.

Experimental RL, pruning, and acceleration profiles are local-only under experiments/configs/; they are ignored by git and excluded from release packages.

Research directions for learned policy/value agents, MCTS priors, local-minimum escape policies, and memory/table-based search are tracked in docs/RESEARCH_PLAN.md.

Compatibility Notes

pymesh.py is a compatibility shim, not the external PyMesh package. It keeps legacy SMART code that imports pymesh working by forwarding to smart.pymesh_compat. New code should import smart.pymesh_compat directly.

Release

Build and validate release artifacts:

smart-release-preflight \
  --dist-dir /private/tmp/smart_release_check \
  --venv-dir /private/tmp/smart_release_venv \
  --recreate-venv \
  --run-asan-smoke

Release notes and publishing steps are in docs/RELEASE.md.

Citation

@inproceedings{park2024smart,
  title = {Split, Merge, and Refine: Fitting Tight Bounding Boxes via Over-Segmentation and Iterative Search},
  author = {Park, Chanhyeok and Sung, Minhyuk},
  booktitle = {International Conference on 3D Vision (3DV)},
  year = {2024}
}

License

This project is released for non-commercial research under CC BY-NC-SA 4.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smart_bbox-0.1.13.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

smart_bbox-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

smart_bbox-0.1.13-cp311-cp311-macosx_11_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

smart_bbox-0.1.13-cp311-cp311-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

smart_bbox-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

smart_bbox-0.1.13-cp310-cp310-macosx_11_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

smart_bbox-0.1.13-cp310-cp310-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

smart_bbox-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

smart_bbox-0.1.13-cp39-cp39-macosx_11_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

smart_bbox-0.1.13-cp39-cp39-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file smart_bbox-0.1.13.tar.gz.

File metadata

  • Download URL: smart_bbox-0.1.13.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smart_bbox-0.1.13.tar.gz
Algorithm Hash digest
SHA256 a5fb518cb610f2187c83a4b8bce3fa8d3108be7b6f7ae2a947f7171f0bb6ad60
MD5 79fb07ee9d62b0ecadaff61f7a22229f
BLAKE2b-256 a22ff91e937f8644ef063ccfdb49a64529072e45c06a376cef86e1338242d7db

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13.tar.gz:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25f8bbdff953ff2f615f40b1d90a413d18da944c909f35acff9ec54d279c03e2
MD5 0b18a2bb05721248c66f7d554455f53c
BLAKE2b-256 f4843faa7d0fc385f76ef8379f5d797e3a6aeb20abfb5fe57664f1efe114d377

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fa68f45395dad7b5d77f4936a4c5b6f2e88aedf5e5cbfc62ecd6732ab7bf3b63
MD5 f33b0561a31523d56454836e2a5e6017
BLAKE2b-256 07e8dfc841331f8b00aa619e12d2e331ddae824e99977ef8b4503522821e10d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp311-cp311-macosx_11_0_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9644f25e73cf461fc350c08c9905d5fca06bba13fc4c73f800d91ea7954cb74
MD5 4e91b1dec3e8eb714a2dc2e9a80a63f3
BLAKE2b-256 d1480b822bef68c17648516ada13300be239534effaf9f08eb7cb67484de7a54

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 458cd34e740c5800e8f621fd576f9ad2925cdd2b40c39e123a3bceefc672caad
MD5 d2eb58777f5c64d21071de3e90aed6f2
BLAKE2b-256 e8935034ec7658d35ed05f451c3e596a7f74259011d4b6b5c8d7d4a457b374fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 961d65a187346333dbae33b4cb392c7f13517b311b2d75f4b7fa4274e4d7521a
MD5 eded7486f658eaf4a9e41af0ef6e94bb
BLAKE2b-256 c68e19ceb490c3a79d8c7be09f2a82e5bcf08afa5c4570c6a646c10cf9ad1370

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp310-cp310-macosx_11_0_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eaf4fa05e9ce29a4d758507a1bc66cd7b83d2ae985de601bd81083393e7e1513
MD5 36d7244366a4617a9eef3a871b2ef89e
BLAKE2b-256 b587e012d01f1ec54989fa2f57d948ae97a6948c4cba8a2f53336c679910dfe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a5ec8a245bb83109f8340f5fa96b431eb8b9cb057c4c9105cf4c53e7887ffff
MD5 10810069de7ce2c05e68fd95f323483b
BLAKE2b-256 e0622e6ef84f064552493c3a74b82c25a2c36adbf0d316563842a2a89bb5c9de

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9d127338d74b9cae610c6a1a645c599166004e42570997db144e64ede027dd7d
MD5 fccc23519d7772092285cd30ce1c6edc
BLAKE2b-256 0b422ee65398839213c2e86c40daa558f652e88fa016d770425fd21f91c5465e

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp39-cp39-macosx_11_0_x86_64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smart_bbox-0.1.13-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for smart_bbox-0.1.13-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b744d17a717f07361082f7404172f6e4cf62502726e39f8d281cf46d700dfbe
MD5 b3f8c5528c3c03cf4ea2535b40ece778
BLAKE2b-256 ef7a2297d68ba0544becefe6014c3acfad5978acafba379c7f728620c236e065

See more details on using hashes here.

Provenance

The following attestation bundles were made for smart_bbox-0.1.13-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on chpark1111/SMART

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page