Comments (4)
Sorry for late response. If you are interested in generating point cloud, you can change the following line in lib/renderer/gl/data/prt.vs
VertexOut.Position = R * pos;
to
VertexOut.Position = pos;
Then you can directly obtain point cloud rendered from the input view by
get_color(self, color_id=2)
You can refer to lib/renderer/gl/data/prt.fs to see what attribute corresponds to which color_id.
Hope it helps.
from pifu.
After change VertexOut.Position = R * pos;
to VertexOut.Position = pos;
in lib/renderer/gl/data/prt.vs
, and insert the following code in apps/render_data.py
,
out_all_z = rndr.get_color(2)
v1, v2 = [], []
for ii in range(512):
for jj in range(512):
if out_all_z[ii, jj][3] != 0.0:
p1 = out_all_z[ii, jj, :3] / y_scale + vmed
v1.append(p1)
X = (jj - 256) * cam.ortho_ratio
Y = (256 - ii) * cam.ortho_ratio
Z = - out_all_z[ii, jj, 3] * 100
p2 = np.array([X, Y, Z]) / y_scale + vmed
v2.append(p2)
v1 = np.array(v1)
v2 = np.array(v2)
with open('v1.obj', 'w') as fp:
fp.write(('v {:f} {:f} {:f}\n' * v1.shape[0]).format(*v1.reshape(-1)))
with open('v2.obj', 'w') as fp:
fp.write(('v {:f} {:f} {:f}\n' * v2.shape[0]).format(*v2.reshape(-1)))
I get the following results: a) is the original input mesh; b) is v1
overlaps on a); c) is the side view, they match perfectly; in d), the green one is v1
, the blue point cloud is v2
(there is a little translation between them)
If I use out_all_z = rndr.get_z_value()
in the first comment, I got the same result as v2
.
I'm a little bit confused about these results, is there anything wrong about on calculation of v2
, or the first way to calculate point cloud?
from pifu.
The output depth should be normalized to [0,1] corresponding to [zNear, zFar] in the original space. As zNear=-100 and zFar=100, your depth renormalization code seems incorrect to me.
How about
Z = - (out_all_z[ii, jj, 3]-0.5) * 200
?
from pifu.
In the first comment:
I use out_all_z = rndr.get_z_value()
and Z = (1 - out_all_z[ii, jj] * 2) * (cam.far - cam.near) / 2
, you can check it.
In the third comment:
I use out_all_z = rndr.get_color(2)
and Z = - out_all_z[ii, jj, 3] * 100
.
As your reply, the first comment was the way you wrote, but there is a little deviation from the input mesh. If I replace the third comment about Z
, the result is wrong.
Thanks for quick reply~
from pifu.
Related Issues (20)
- the tensor not mach HOT 1
- Some questions about dataset format and color model training HOT 2
- Training on dennis obj does not yield satisfactory results HOT 10
- freeglut (foo): failed to open display 'localhost:12.0'
- One question about multiview training HOT 1
- Unable to train the model
- How to make the texture image? HOT 2
- Data preparation memory leak HOT 2
- Training data
- How to get the UV map
- Transformation Questions
- problem when i run prt_util HOT 2
- error: ('The size of tensor a (85) must match the size of tensor b (84) at non-singleton dimension 2',) HOT 1
- I want to use only tex-pifu
- PIFu_Demo.ipynb error HOT 1
- sh ./scripts/download_trained_model.sh error
- sh ./scripts/test.sh error HOT 1
- sh ./scripts/test.sh error HOT 2
- ERROR ./scripts/test.sh HOT 3
- training_data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pifu.