File size: 1,554 Bytes
8a1ba16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
One-click demo: creates a synthetic sphere point cloud and runs the full pipeline.
Perfect for beginners who want to see it work immediately.

Usage:
    python example/demo.py
"""
import subprocess
import sys
import os

# 1. Generate synthetic data
print("=" * 60)
print("Step 1: Creating a synthetic sphere point cloud...")
print("=" * 60)
result = subprocess.run([sys.executable, os.path.join(os.path.dirname(__file__), "make_sphere.py")])
if result.returncode != 0:
    print("Failed to generate sphere. Aborting.")
    sys.exit(1)

# 2. Run the pipeline with reduced iterations for speed
print("\n" + "=" * 60)
print("Step 2: Running LightweightMR (reduced quality for speed)...")
print("  This will take ~5–15 minutes on CPU, ~1 minute on GPU.")
print("=" * 60)
cmd = [
    sys.executable, "-m", "lightweightmr",
    "-i", "example/sphere.ply",
    "-o", "example/sphere_mesh.ply",
    "--device", "cpu",
    "--sdf-iters", "5000",
    "--vg-iters", "2000",
    "--vertices", "800",
]
print(f"Command: {' '.join(cmd)}\n")
result = subprocess.run(cmd)
if result.returncode != 0:
    print("Pipeline failed. See error above.")
    sys.exit(1)

print("\n" + "=" * 60)
print("SUCCESS!")
print("=" * 60)
print(f"  Input:  example/sphere.ply")
print(f"  Output: example/sphere_mesh.ply")
print("\nOpen the mesh in Blender, MeshLab, or Windows 3D Viewer.")
print("For better quality, re-run with more iterations:")
print("  python -m lightweightmr -i example/sphere.ply -o example/sphere_mesh.ply --sdf-iters 20000 --vg-iters 8000 --vertices 3400")