Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -584,10 +584,10 @@ def findNormals():
|
|
584 |
dzdx = ((depth[x + 1, y] - depth[x - 1, y]) / 2.0).astype(np.float32)
|
585 |
dzdy = ((depth[x, y + 1] - depth[x, y - 1]) / 2.0).astype(np.float32)
|
586 |
|
587 |
-
d = np.
|
588 |
normals[x, y] = d / np.linalg.norm(d)
|
589 |
|
590 |
-
return (normals * 255).astype(np.uint8)
|
591 |
|
592 |
|
593 |
load_model="""
|
|
|
584 |
dzdx = ((depth[x + 1, y] - depth[x - 1, y]) / 2.0).astype(np.float32)
|
585 |
dzdy = ((depth[x, y + 1] - depth[x, y - 1]) / 2.0).astype(np.float32)
|
586 |
|
587 |
+
d = np.array([dzdx, dzdy, np.float32(1.0)], dtype=np.float32)
|
588 |
normals[x, y] = d / np.linalg.norm(d)
|
589 |
|
590 |
+
return (normals * 255 + 127).astype(np.uint8)
|
591 |
|
592 |
|
593 |
load_model="""
|