autoforge 1.3.4__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.4 → autoforge-1.3.5}/PKG-INFO +1 -1
- {autoforge-1.3.4 → autoforge-1.3.5}/pyproject.toml +1 -1
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/PKG-INFO +1 -1
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/OptimizerHelper.py +2 -2
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Misc/color_fit_all.py +23 -9
- {autoforge-1.3.4 → autoforge-1.3.5}/README.md +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/setup.cfg +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/SOURCES.txt +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/dependency_links.txt +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/entry_points.txt +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/requires.txt +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/AutoForge.egg-info/top_level.txt +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/FilamentHelper.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/ImageHelper.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/OutputHelper.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/PruningHelper.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Helper/__init__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Loss/LossFunctions.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Loss/PerceptionLoss.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Loss/__init__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Misc/__init__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Modules/Optimizer.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/Modules/__init__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/__init__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/__main__.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/auto_forge.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/auto_forge_gradio.py +0 -0
- {autoforge-1.3.4 → autoforge-1.3.5}/src/autoforge/filamentcolors_library.py +0 -0
- {autoforge-1.3.4 → 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"
|
|
@@ -147,11 +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 <= h, torch.tensor(1.0), opac)
|
|
154
|
+
# opac = torch.where(TD_i / 10 <= h, torch.tensor(1.0), opac)
|
|
155
155
|
opac = torch.clamp(opac, 0.0, 1.0)
|
|
156
156
|
|
|
157
157
|
comp = comp + ((remaining * opac).unsqueeze(-1) * color_i)
|
|
@@ -959,11 +959,11 @@ def model_composite(
|
|
|
959
959
|
#############################################
|
|
960
960
|
|
|
961
961
|
extra_models = {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
962
|
+
"Model 1: Linear": {
|
|
963
|
+
"func": model_linear,
|
|
964
|
+
"ranges": [(0.0, 1.0)],
|
|
965
|
+
"param_names": ["p0"],
|
|
966
|
+
},
|
|
967
967
|
"Model 13: New Model 4: Log-Linear": {
|
|
968
968
|
"func": new_model4,
|
|
969
969
|
"ranges": [(0.0, 1.0), (0.0, 100.0), (0.0, 1.0)],
|
|
@@ -1516,7 +1516,6 @@ class VectorizedLossModule(torch.jit.ScriptModule):
|
|
|
1516
1516
|
color_i = foregrounds
|
|
1517
1517
|
opac = offset + self.model_func(model_params, t_tensor, TD_i)
|
|
1518
1518
|
opac = torch.clamp(opac, 0.0, 1.0)
|
|
1519
|
-
# opac = torch.where(TD_i <= 0.4, torch.tensor(1.0), opac)
|
|
1520
1519
|
comp = comp + ((remaining * opac).unsqueeze(-1) * color_i)
|
|
1521
1520
|
remaining = remaining * (1 - opac)
|
|
1522
1521
|
|
|
@@ -1639,8 +1638,11 @@ def optimize_model(
|
|
|
1639
1638
|
if no_improvement_count >= 10000:
|
|
1640
1639
|
break
|
|
1641
1640
|
# break if loss decrease is less than 1e-6 in last 100 steps
|
|
1642
|
-
|
|
1643
|
-
|
|
1641
|
+
if (
|
|
1642
|
+
len(losses) > 1000
|
|
1643
|
+
and np.mean(losses[-1000:-100]) - np.min(losses[-100:]) < 1e-3
|
|
1644
|
+
):
|
|
1645
|
+
break
|
|
1644
1646
|
it += 1
|
|
1645
1647
|
tbar.update(1)
|
|
1646
1648
|
except Exception:
|
|
@@ -1821,6 +1823,18 @@ def main():
|
|
|
1821
1823
|
# "param_names": ["A", "k", "B"],
|
|
1822
1824
|
# },
|
|
1823
1825
|
# }
|
|
1826
|
+
extra_models = {
|
|
1827
|
+
# "Model 28: Poly Degree 2": {
|
|
1828
|
+
# "func": model_poly2,
|
|
1829
|
+
# "ranges": [(0.0, 1.0)],
|
|
1830
|
+
# "param_names": ["p0"],
|
|
1831
|
+
# },
|
|
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"],
|
|
1836
|
+
},
|
|
1837
|
+
}
|
|
1824
1838
|
|
|
1825
1839
|
results = []
|
|
1826
1840
|
# Loop over each candidate model in the dictionary.
|
|
@@ -1871,7 +1885,7 @@ def main():
|
|
|
1871
1885
|
# Now plot measured vs predicted for 10 random CSV rows using Plotly,
|
|
1872
1886
|
# but only for the top 3 best models.
|
|
1873
1887
|
best_three = results[:3]
|
|
1874
|
-
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)
|
|
1875
1889
|
|
|
1876
1890
|
|
|
1877
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
|