Giter Club home page Giter Club logo

Comments (14)

ebrahimkhalilabbasi avatar ebrahimkhalilabbasi commented on August 29, 2024 1

@bertjiazheng and @marcomiglionico94
Could you please share with us the code you implemented to visualise the 3D model?

from noncuboidroom.

bertjiazheng avatar bertjiazheng commented on August 29, 2024

Hi @marcomiglionico94

I think this may be due to the incorrect depth distance we used. You may try two different depths: i) distance from the point to the image plane or ii) distance from point to the camera center.

Best,
Jia

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

Hi @marcomiglionico94

I think this may be due to the incorrect depth distance we used. You may try two different depths: i) distance from the point to the image plane or ii) distance from point to the camera center.

Best, Jia

Hi thanks for the quick answer, where exactly I can find that distance parameter that you used? Can you refer to the file or line of code where I can find it

from noncuboidroom.

CYang0515 avatar CYang0515 commented on August 29, 2024

For a point (x,y,z) in 3D space, the depth map extracted by network is the z coordinate, not the np.sqrt(x^2+y^2+z^2).

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

Hi @marcomiglionico94

I think this may be due to the incorrect depth distance we used. You may try two different depths: i) distance from the point to the image plane or ii) distance from point to the camera center.

Best, Jia

Is it possible to know at least what kind of visualization you use for the paper? Did you use Open3D or something else?

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

For a point (x,y,z) in 3D space, the depth map extracted by network is the z coordinate, not the np.sqrt(x^2+y^2+z^2).

I know that, but in the code the depth map is basically created in ConvertLayout function, in particular in this part of code:

n_d = param[:3] / np.clip(param[3], 1e-8, 1e8) # meter n/d n_d = n_d[np.newaxis, np.newaxis, :] inverdepth = -1 * np.sum(np.dot(n_d, K_inv) * ixy1map, axis=2) depth[mask] = inverdepth[mask]

My question is which parameters can I change so that the depthmap is not curved? I imagine that in the reconstruction you show in the paper you used a depth map, to make the 3d visualization. But not a curved one otherswise your results will look like the image I posted at the beginning of this issue.

from noncuboidroom.

bertjiazheng avatar bertjiazheng commented on August 29, 2024

Hi @marcomiglionico94
I think this may be due to the incorrect depth distance we used. You may try two different depths: i) distance from the point to the image plane or ii) distance from point to the camera center.
Best, Jia

Is it possible to know at least what kind of visualization you use for the paper? Did you use Open3D or something else?

We use Open3D to visualize the reconstructed 3D model.

from noncuboidroom.

CYang0515 avatar CYang0515 commented on August 29, 2024

Hi, @marcomiglionico94
There is a mistake about the variable name. The returned depth in code is the inverse of depth. So the actually depth is by 1/depth.

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

Hi, @marcomiglionico94 There is a mistake about the variable name. The returned depth in code is the inverse of depth. So the actually depth is by 1/depth.

Hi thanks for your reply. I am not very sure about this. When i return 1/depth the results of the depthmap are very strange since only a small part of the scene is included, the rest is missing. In fact before the values of the depthmap are between 0 and 1, but after i do 1/depth all the values are around 2 or 3, which I don't think is correct. Maybe you mean depth = np.ones_like(depth) - depth ??
Trying to figure out what is the problem

from noncuboidroom.

CYang0515 avatar CYang0515 commented on August 29, 2024

We add an example on NYU303 dataset. The actually depth is 1/depth, not depth = np.ones_like(depth) - depth.

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

Using depth = np.ones_like(depth) - depth I was able to obtain the following visualization, which seems correct.
Screen Shot 2021-12-01 at 5 08 31 PM

Using 1/depth instead, this is what i was getting for the same image:
Screen Shot 2021-12-01 at 3 55 36 PM

from noncuboidroom.

marcomiglionico94 avatar marcomiglionico94 commented on August 29, 2024

We add an example on NYU303 dataset. The actually depth is 1/depth, not depth = np.ones_like(depth) - depth.

Hello, I realized that if I use 1/depth it only works if then I divide the values of the depthmap by the max value of it, only to scale the values between 0 and 1 so that I can visualize them. Do you know if that is the correct approach? or is there another way to scale the values of the depthmap between 0 and 1 so that I can visualize it?

from noncuboidroom.

Cli98 avatar Cli98 commented on August 29, 2024

@marcomiglionico94 I wonder if it could be possible for you to briefly discuss how you solve the problem?

from noncuboidroom.

HardikJain02 avatar HardikJain02 commented on August 29, 2024

hey @marcomiglionico94, can you share the code you have implemented for 3D visualization. Also, I am trying to implement this function DisplayMeshLayout in reconstruction.py for my custom images in test.py

It needs these as input def DisplayMeshLayout(ups, downs, attribution, pwalls, pceiling, pfloor, ixy1map, K_inv)

This is I have implemented it in test.py

DisplayMeshLayout(ups, downs, attribution, pwalls=params_layout, pceiling=pceiling, pfloor=pfloor, ixy1map=inputs['ixy1map'][i].cpu().numpy(), K_inv = np.linalg.inv(inputs['intri'][i].cpu().numpy()))

I am getting this error:

Traceback (most recent call last):
  File "/workspace/hardik/NonCuboidRoom/test.py", line 508, in <module>
    test_custom(model, criterion, dataloader, device, cfg)
  File "/workspace/hardik/NonCuboidRoom/test.py", line 370, in test_custom
    DisplayMeshLayout(ups, downs, attribution, pwalls=params_layout, pceiling=pceiling, pfloor=pfloor, ixy1map=inputs['ixy1map'][i].cpu().numpy(), K_inv = np.linalg.inv(inputs['intri'][i].cpu().numpy()))
  File "/workspace/hardik/NonCuboidRoom/models/reconstruction.py", line 669, in DisplayMeshLayout
    poly = empty_polygon.intersection(poly)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/anaconda3/envs/layout/lib/python3.12/site-packages/shapely/geometry/base.py", line 599, in intersection
    return shapely.intersection(self, other, grid_size=grid_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/anaconda3/envs/layout/lib/python3.12/site-packages/shapely/decorators.py", line 77, in wrapped
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/anaconda3/envs/layout/lib/python3.12/site-packages/shapely/set_operations.py", line 131, in intersection
    return lib.intersection(a, b, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
shapely.errors.GEOSException: TopologyException: side location conflict at 297 72.826979472140764. This can occur if the input geometry is invalid.

from noncuboidroom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.