autoforge 1.3.3__tar.gz → 1.3.5__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.
- {autoforge-1.3.3 → autoforge-1.3.5}/PKG-INFO +1 -1
- {autoforge-1.3.3 → autoforge-1.3.5}/pyproject.toml +1 -1
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/PKG-INFO +1 -1
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/OptimizerHelper.py +6 -5
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Misc/color_fit_all.py +26 -11
- {autoforge-1.3.3 → autoforge-1.3.5}/README.md +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/setup.cfg +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/SOURCES.txt +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/dependency_links.txt +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/entry_points.txt +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/requires.txt +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/AutoForge.egg-info/top_level.txt +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/FilamentHelper.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/ImageHelper.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/OutputHelper.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/PruningHelper.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Helper/__init__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Loss/LossFunctions.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Loss/PerceptionLoss.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Loss/__init__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Misc/__init__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Modules/Optimizer.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/Modules/__init__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/__init__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/__main__.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/auto_forge.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/auto_forge_gradio.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/filamentcolors_library.py +0 -0
- {autoforge-1.3.3 → autoforge-1.3.5}/src/autoforge/old_jax_files.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "AutoForge"
|
|
7
|
-
version="1.3.
|
|
7
|
+
version="1.3.5"
|
|
8
8
|
description = "AutoForge is a Python tool for generating 3D printed layered models from an input image."
|
|
9
9
|
authors = [{ name = "Hendric Voss", email = "hvoss@techfak.uni-bielefeld.de" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -112,10 +112,10 @@ def composite_image(
|
|
|
112
112
|
comp = torch.zeros(H, W, 3, dtype=torch.float32, device=pixel_height.device)
|
|
113
113
|
remaining = torch.ones(H, W, dtype=torch.float32, device=pixel_height.device)
|
|
114
114
|
|
|
115
|
-
o = -1.
|
|
116
|
-
A =
|
|
117
|
-
k = 3.
|
|
118
|
-
b = -
|
|
115
|
+
o = -1.2416557e-02
|
|
116
|
+
A = 9.6407950e-01
|
|
117
|
+
k = 3.4103447e01
|
|
118
|
+
b = -4.1554203e00
|
|
119
119
|
|
|
120
120
|
for i in range(max_layers):
|
|
121
121
|
layer_idx = max_layers - 1 - i
|
|
@@ -147,10 +147,11 @@ def composite_image(
|
|
|
147
147
|
p_i = F.gumbel_softmax(global_logits[layer_idx], tau_global, hard=True)
|
|
148
148
|
|
|
149
149
|
color_i = torch.matmul(p_i, material_colors)
|
|
150
|
-
TD_i = torch.matmul(p_i, material_TDs)
|
|
150
|
+
TD_i = torch.matmul(p_i, material_TDs)
|
|
151
151
|
TD_i = torch.clamp(TD_i, 1e-8, 1e8)
|
|
152
152
|
|
|
153
153
|
opac = o + (A * torch.log1p(k * (eff_thick / TD_i)) + b * (eff_thick / TD_i))
|
|
154
|
+
# opac = torch.where(TD_i / 10 <= h, torch.tensor(1.0), opac)
|
|
154
155
|
opac = torch.clamp(opac, 0.0, 1.0)
|
|
155
156
|
|
|
156
157
|
comp = comp + ((remaining * opac).unsqueeze(-1) * color_i)
|
|
@@ -1638,8 +1638,11 @@ def optimize_model(
|
|
|
1638
1638
|
if no_improvement_count >= 10000:
|
|
1639
1639
|
break
|
|
1640
1640
|
# break if loss decrease is less than 1e-6 in last 100 steps
|
|
1641
|
-
|
|
1642
|
-
|
|
1641
|
+
if (
|
|
1642
|
+
len(losses) > 1000
|
|
1643
|
+
and np.mean(losses[-1000:-100]) - np.min(losses[-100:]) < 1e-3
|
|
1644
|
+
):
|
|
1645
|
+
break
|
|
1643
1646
|
it += 1
|
|
1644
1647
|
tbar.update(1)
|
|
1645
1648
|
except Exception:
|
|
@@ -1808,16 +1811,28 @@ def main():
|
|
|
1808
1811
|
layer_thickness = 0.04 # mm per layer
|
|
1809
1812
|
transmissions, backgrounds, foregrounds, measured = preprocess_data(df, num_layers)
|
|
1810
1813
|
|
|
1814
|
+
# extra_models = {
|
|
1815
|
+
# # "Model 43: Gamma CDF": {
|
|
1816
|
+
# # "func": model_gamma,
|
|
1817
|
+
# # "ranges": [(0.0, 1.0), (0.1, 5.0), (0.1, 5.0)],
|
|
1818
|
+
# # "param_names": ["p0", "p1", "p2"],
|
|
1819
|
+
# # },
|
|
1820
|
+
# "Model 13: New Model 4: Log-Linear": {
|
|
1821
|
+
# "func": new_model4,
|
|
1822
|
+
# "ranges": [(0.0, 1.0), (0.0, 200.0), (0.0, 1.0)],
|
|
1823
|
+
# "param_names": ["A", "k", "B"],
|
|
1824
|
+
# },
|
|
1825
|
+
# }
|
|
1811
1826
|
extra_models = {
|
|
1812
|
-
# "Model
|
|
1813
|
-
# "func":
|
|
1814
|
-
# "ranges": [(0.0, 1.0)
|
|
1815
|
-
# "param_names": ["p0"
|
|
1827
|
+
# "Model 28: Poly Degree 2": {
|
|
1828
|
+
# "func": model_poly2,
|
|
1829
|
+
# "ranges": [(0.0, 1.0)],
|
|
1830
|
+
# "param_names": ["p0"],
|
|
1816
1831
|
# },
|
|
1817
|
-
"Model
|
|
1818
|
-
"func":
|
|
1819
|
-
"ranges": [(0.0, 1.0), (0.0,
|
|
1820
|
-
"param_names": ["
|
|
1832
|
+
"Model 29: Poly Degree 3": {
|
|
1833
|
+
"func": model_poly3,
|
|
1834
|
+
"ranges": [(0.0, 1.0), (0.0, 1.0)],
|
|
1835
|
+
"param_names": ["p0", "p1"],
|
|
1821
1836
|
},
|
|
1822
1837
|
}
|
|
1823
1838
|
|
|
@@ -1870,7 +1885,7 @@ def main():
|
|
|
1870
1885
|
# Now plot measured vs predicted for 10 random CSV rows using Plotly,
|
|
1871
1886
|
# but only for the top 3 best models.
|
|
1872
1887
|
best_three = results[:3]
|
|
1873
|
-
plot_measured_vs_predicted(best_three, df, 16, layer_thickness, sample_size=
|
|
1888
|
+
plot_measured_vs_predicted(best_three, df, 16, layer_thickness, sample_size=50)
|
|
1874
1889
|
|
|
1875
1890
|
|
|
1876
1891
|
if __name__ == "__main__":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|