Commit ·
3fc7370
1
Parent(s): 293fbf3
Update activation function in RgbMlp class to use tanh for improved output range
Browse files- inference.py +2 -2
- model/archs/mlp_head.py +2 -1
inference.py
CHANGED
|
@@ -101,6 +101,6 @@ def generate3d(model, rgb, ccm, device):
|
|
| 101 |
elapsed_time = end_time - start_time
|
| 102 |
print(f"uv takes {elapsed_time}s")
|
| 103 |
|
| 104 |
-
print("Raw color min/max/mean:", colors.min(), colors.max(), colors.mean())
|
| 105 |
-
print("Scaled color min/max/mean:", colors.min(), colors.max(), colors.mean())
|
| 106 |
return mesh_path_glb+".obj"
|
|
|
|
| 101 |
elapsed_time = end_time - start_time
|
| 102 |
print(f"uv takes {elapsed_time}s")
|
| 103 |
|
| 104 |
+
# print("Raw color min/max/mean:", colors.min(), colors.max(), colors.mean())
|
| 105 |
+
# print("Scaled color min/max/mean:", colors.min(), colors.max(), colors.mean())
|
| 106 |
return mesh_path_glb+".obj"
|
model/archs/mlp_head.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import torch.nn as nn
|
| 2 |
import torch.nn.functional as F
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
class SdfMlp(nn.Module):
|
|
@@ -34,7 +35,7 @@ class RgbMlp(nn.Module):
|
|
| 34 |
x = F.relu(self.fc1(input))
|
| 35 |
x = F.relu(self.fc2(x))
|
| 36 |
out = self.fc3(x)
|
| 37 |
-
|
| 38 |
return out
|
| 39 |
|
| 40 |
|
|
|
|
| 1 |
import torch.nn as nn
|
| 2 |
import torch.nn.functional as F
|
| 3 |
+
import torch
|
| 4 |
|
| 5 |
|
| 6 |
class SdfMlp(nn.Module):
|
|
|
|
| 35 |
x = F.relu(self.fc1(input))
|
| 36 |
x = F.relu(self.fc2(x))
|
| 37 |
out = self.fc3(x)
|
| 38 |
+
out = torch.tanh(out)
|
| 39 |
return out
|
| 40 |
|
| 41 |
|