autoforge 1.3.2__tar.gz → 1.3.4__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.2 → autoforge-1.3.4}/PKG-INFO +1 -1
- {autoforge-1.3.2 → autoforge-1.3.4}/pyproject.toml +1 -1
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/PKG-INFO +1 -1
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/OptimizerHelper.py +5 -6
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Misc/color_fit_all.py +18 -17
- {autoforge-1.3.2 → autoforge-1.3.4}/README.md +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/setup.cfg +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/SOURCES.txt +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/dependency_links.txt +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/entry_points.txt +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/requires.txt +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/AutoForge.egg-info/top_level.txt +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/FilamentHelper.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/ImageHelper.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/OutputHelper.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/PruningHelper.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Helper/__init__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Loss/LossFunctions.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Loss/PerceptionLoss.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Loss/__init__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Misc/__init__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Modules/Optimizer.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/Modules/__init__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/__init__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/__main__.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/auto_forge.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/auto_forge_gradio.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/src/autoforge/filamentcolors_library.py +0 -0
- {autoforge-1.3.2 → autoforge-1.3.4}/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.4"
|
|
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
|
|
@@ -151,9 +151,8 @@ def composite_image(
|
|
|
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
155
|
opac = torch.clamp(opac, 0.0, 1.0)
|
|
155
|
-
# Setting opac to 1.0 for the layers where the thickness is less than 2*h to avoid single layer artifacts
|
|
156
|
-
opac = torch.where(TD_i <= h * 2, torch.tensor(1.0), opac)
|
|
157
156
|
|
|
158
157
|
comp = comp + ((remaining * opac).unsqueeze(-1) * color_i)
|
|
159
158
|
remaining = remaining * (1 - opac)
|
|
@@ -959,11 +959,11 @@ def model_composite(
|
|
|
959
959
|
#############################################
|
|
960
960
|
|
|
961
961
|
extra_models = {
|
|
962
|
-
"Model 1: Linear": {
|
|
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,6 +1516,7 @@ 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)
|
|
1519
1520
|
comp = comp + ((remaining * opac).unsqueeze(-1) * color_i)
|
|
1520
1521
|
remaining = remaining * (1 - opac)
|
|
1521
1522
|
|
|
@@ -1808,18 +1809,18 @@ def main():
|
|
|
1808
1809
|
layer_thickness = 0.04 # mm per layer
|
|
1809
1810
|
transmissions, backgrounds, foregrounds, measured = preprocess_data(df, num_layers)
|
|
1810
1811
|
|
|
1811
|
-
extra_models = {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
}
|
|
1812
|
+
# extra_models = {
|
|
1813
|
+
# # "Model 43: Gamma CDF": {
|
|
1814
|
+
# # "func": model_gamma,
|
|
1815
|
+
# # "ranges": [(0.0, 1.0), (0.1, 5.0), (0.1, 5.0)],
|
|
1816
|
+
# # "param_names": ["p0", "p1", "p2"],
|
|
1817
|
+
# # },
|
|
1818
|
+
# "Model 13: New Model 4: Log-Linear": {
|
|
1819
|
+
# "func": new_model4,
|
|
1820
|
+
# "ranges": [(0.0, 1.0), (0.0, 200.0), (0.0, 1.0)],
|
|
1821
|
+
# "param_names": ["A", "k", "B"],
|
|
1822
|
+
# },
|
|
1823
|
+
# }
|
|
1823
1824
|
|
|
1824
1825
|
results = []
|
|
1825
1826
|
# Loop over each candidate model in the dictionary.
|
|
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
|