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

get a sphere noise point around the target #26

Closed
Yes-Jumby opened this issue Dec 25, 2021 · 4 comments
Closed

get a sphere noise point around the target #26

Yes-Jumby opened this issue Dec 25, 2021 · 4 comments

Comments

@Yes-Jumby
Copy link

Yes-Jumby commented Dec 25, 2021

i use the default params ,preprocessed data using colmap script by you and train on my data,but get this strenge results:the target is good except the points around.
image
000

@Yes-Jumby Yes-Jumby changed the title get a sphere point around the target get a sphere noise point around the target Dec 25, 2021
@Yes-Jumby
Copy link
Author

I note i have choose interes area,maybe i make the interest area too small?If so,why other scene works well? any advice?

@Totoro97
Copy link
Owner

Hello, yes the strange sphere looks outside the region of interest. I have just done a hack to this issue - could you try this extract_fields function below (to replace the original extract_fields function at L10 of models/renderer.py) and re-extract the mesh from your trained model again? Thanks!

def extract_fields(bound_min, bound_max, resolution, query_func):
    N = 64
    X = torch.linspace(bound_min[0], bound_max[0], resolution).split(N)
    Y = torch.linspace(bound_min[1], bound_max[1], resolution).split(N)
    Z = torch.linspace(bound_min[2], bound_max[2], resolution).split(N)

    u = np.zeros([resolution, resolution, resolution], dtype=np.float32)
    with torch.no_grad():
        for xi, xs in enumerate(X):
            for yi, ys in enumerate(Y):
                for zi, zs in enumerate(Z):
                    xx, yy, zz = torch.meshgrid(xs, ys, zs)
                    pts = torch.cat([xx.reshape(-1, 1), yy.reshape(-1, 1), zz.reshape(-1, 1)], dim=-1)
                    dis = torch.linalg.norm(pts, ord=2, dim=-1, keepdim=False)
                    val = query_func(pts).reshape(-1)
                    val[torch.where(dis > 1.0)] = -1.0
                    val = val.reshape(len(xs), len(ys), len(zs)).detach().cpu().numpy()
                    u[xi * N: xi * N + len(xs), yi * N: yi * N + len(ys), zi * N: zi * N + len(zs)] = val
    return u

@Yes-Jumby
Copy link
Author

Yes-Jumby commented Dec 25, 2021

1640420876(1)
i replace the function:answer is :reduce noise in the top ,but still have the noise
here is the reoutput ply file.
https://drive.google.com/file/d/1Ap3h6IBH1LbhuhMyuJ7vzN0MlXbItsbG/view?usp=sharing

Hello, yes the strange sphere looks outside the region of interest. I have just done a hack to this issue - could you try this extract_fields function below (to replace the original extract_fields function at L10 of models/renderer.py) and re-extract the mesh from your trained model again? Thanks!

def extract_fields(bound_min, bound_max, resolution, query_func):
    N = 64
    X = torch.linspace(bound_min[0], bound_max[0], resolution).split(N)
    Y = torch.linspace(bound_min[1], bound_max[1], resolution).split(N)
    Z = torch.linspace(bound_min[2], bound_max[2], resolution).split(N)

    u = np.zeros([resolution, resolution, resolution], dtype=np.float32)
    with torch.no_grad():
        for xi, xs in enumerate(X):
            for yi, ys in enumerate(Y):
                for zi, zs in enumerate(Z):
                    xx, yy, zz = torch.meshgrid(xs, ys, zs)
                    pts = torch.cat([xx.reshape(-1, 1), yy.reshape(-1, 1), zz.reshape(-1, 1)], dim=-1)
                    dis = torch.linalg.norm(pts, ord=2, dim=-1, keepdim=False)
                    val = query_func(pts).reshape(-1)
                    val[torch.where(dis > 1.0)] = -1.0
                    val = val.reshape(len(xs), len(ys), len(zs)).detach().cpu().numpy()
                    u[xi * N: xi * N + len(xs), yi * N: yi * N + len(ys), zi * N: zi * N + len(zs)] = val
    return u

@Yes-Jumby
Copy link
Author

image
here is the validate_image,it is perfect .

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