Skip to content

Commit 107c206

Browse files
authored
Port over baseline Fuzzy Metaballs module (#6)
## Summary of Changes Integrate the original [Fuzzy Metaballs differentiable renderer](https://github.com/leonidk/fuzzy-metaballs) as well as [Arijit's run_fmb.py script](https://github.com/arijit-dasgupta/fuzzy-metaballs/blob/main/run_fmb.py), add a script for downloading test assets (the cow), and ensure compatibility with Python 3.12+. The original pyrender has not been maintained since 3 years ago, and it's broken for Python 3.12 and above (see mmatl/pyrender#305). As such, I'm pinning the dependency to a fork of pyrender found [here](mmatl/pyrender#305 (comment)). ## Test Plan You should be able to download the cow data and run fmb with: ```bash # download the cow data -- this only need to be done once bash scripts/data/download_cow.sh pixi run python examples/run_fmb.py ```
1 parent b84096b commit 107c206

File tree

9 files changed

+2086
-23
lines changed

9 files changed

+2086
-23
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
**/__pycache__/**
22
build/
3+
/data/
4+
/output/

examples/fmb_config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Fuzzy Metaballs Configuration
2+
# Based on: "Approximate Differentiable Rendering with Algebraic Surfaces"
3+
# Keselman & Hebert, ECCV 2022
4+
5+
# Model Parameters
6+
model:
7+
num_mixtures: 40 # Number of Gaussian mixture components
8+
gmm_init_scale: 1.0 # Initial scale for GMM weights
9+
rand_sphere_size: 30 # Initial sphere size for random initialization
10+
11+
# Rendering Parameters
12+
rendering:
13+
num_views: 20 # Number of camera views
14+
image_width: 64 # Image width in pixels
15+
image_height: 64 # Image height in pixels
16+
vfov_degrees: 45 # Vertical field of view in degrees
17+
18+
# Optimization Parameters
19+
optimization:
20+
num_epochs: 10 # Maximum number of training epochs
21+
batch_size: 800 # Number of rays per batch
22+
initial_lr: 0.1 # Initial learning rate
23+
opt_shape_scale: 2.2 # Shape scale multiplier for optimization
24+
clip_alpha: 3.0e-8 # Minimum alpha clipping value
25+
26+
# Learning rate schedule (DegradeLR parameters)
27+
lr_decay_p_thresh: 0.5 # Probability threshold for LR decay
28+
lr_decay_window: 10 # Window size for slope estimation
29+
lr_decay_p_window: 5 # Window for probability evaluation
30+
lr_decay_slope_less: -1.0e-4 # Slope threshold for LR decay
31+
lr_decay_max_drops: 4 # Maximum number of LR drops before stopping
32+
33+
# Hyperparameters (from fm_render.py)
34+
# These control the rendering behavior
35+
hyperparams:
36+
beta2_exp: 2.0 # Exponent for beta2 (distance weighting)
37+
beta3_exp: 0.25 # Exponent for beta3 (density weighting)
38+
39+
# Random Seed
40+
random_seed: 42 # Random seed for reproducibility
41+
42+
# Input/Output
43+
io:
44+
mesh_file: "data/cow/cow.obj" # Path to input mesh file
45+
output_dir: "output/fmb" # Directory for output files
46+
save_model: true # Whether to save trained model
47+
model_filename: "fuzzy_cow_shape.pkl" # Trained model filename

0 commit comments

Comments
 (0)