Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prt_util weird code #69

Closed
sxyu opened this issue Sep 5, 2020 · 1 comment
Closed

prt_util weird code #69

sxyu opened this issue Sep 5, 2020 · 1 comment

Comments

@sxyu
Copy link
Contributor

sxyu commented Sep 5, 2020

Hi Shunsuke,

I've been reading apps/prt_util.py. Please point out if I am understanding incorrectly, but I feel this code is very strange:

def computePRT(mesh_path, n, order):
    vectors, phi, theta = sampleSphericalDirections(n)
    SH = getSHCoeffs(order, phi, theta)
    ...
    for i in tqdm(range(n)):
        SH = np.repeat(SH[None,(i*n):((i+1)*n)], n_v, axis=0).reshape(-1,SH.shape[1])
        vectors = np.repeat(vectors[None,(i*n):((i+1)*n)], n_v, axis=0).reshape(-1,3)

For i>0, doesn't all SH and vectors get overwritten (and use the previous value) rather than a random one? So it is only using 40 directions rather than 40*40..

Thanks,
Alex

@shunsukesaito
Copy link
Owner

Thanks for the fix!! Yes it is the bug and potentially degraded the accuracy of PRT reconstruction.

shunsukesaito added a commit that referenced this issue Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants