-
Notifications
You must be signed in to change notification settings - Fork 41
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
Panorama 360 #19
Comments
Hi, MoGe is designed to handle natural perspective images. While it’s possible to use MoGe with panorama images, it would require a few modifications (which could be quite tedious). Here's one approach to obtain a panorama depth map:
The panorama depth map can be easily lifted to 3D points via |
Thank you for your response. I appreciate your help. I would like to ask if it’s possible to extract points directly from a 360-degree image or environment. Currently, I am using a script with dep-anything to obtain points.
Looking forward to your guidance on this matter. |
The code is for lifting panorama depth map to 3D points. However, the problem here is how to obtain the panorama depth map. If using generalized monocular depth estimation like DepthAnything and MoGe, it is a better idea to divide a panorama image into several perspective images, infer respectively and finally fuse them together. I am planning to implement one in a separate inference script. Please stay tuned. |
@EasternJournalist Hi, thank you for sharing your thoughtful approach. it's a clever strategy to tackle the limitations of generalized models with panorama images. Good luck with your implementation. |
@sctrueew Hi. I have added scripts/infer_panorama.py. Also check the README please. Your feedback is welcome. |
@EasternJournalist Hi, thank you for the implementation. I will check it soon and give you the feedback. |
Thanks, @EasternJournalist! For the amazing work. I tried both infer_panorama and the regular infer function on a standard image. Now, coming back to my tests with infer_panorama.py, I encountered an issue when processing a 4K panoramic view it is really slow 5min on an RTX 3090. Is that to be expected? Here's the Python output:
Current debug Steps:
I suspect that this warning is unrelated to the root cause of the infer_panorama being so slow?
Maybe that helps already a bit. PS: Maybe you could update splited into splitted with (tt), if time allows it. |
To my mind came another issue in the utils3d/numpy/transforms.py I received as well an error
Which I fixed with:
|
@DiamondGlassDrill Hi, thanks for providing the debugging information! Q1: infer_panorama.py merging is very slow The slow merging process might be due to inferring on a very high-resolution panorama image (e.g., 4K). High resolutions significantly slow down the merging step. The script operates in two stages: first, inferring on separate views, and second, merging them. The initial step involves running MoGe on 12 individual views, which is efficient on GPUs. The merging step, however, performs a least-squares optimization with scipy on the CPU. For a medium resolution (1920x960), this typically takes around 10 seconds. However, higher resolutions increase the optimization time quadratically. As a quick fix, you can try using the --resize 1920 option. Since 1920x960 is sufficient to capture geometry details, I will update the code to limit the resolution for depth merging, ensuring the optimization time remains manageable. Q2: Runtime warnings However, invalid depth values should be set to zeros or left unchanged instead of infinity. This is because valid points are filtered using the condition depth > 0 when projecting spherical points onto separate views. Keeping invalid points might lead to a smoother optimization target during depth merging, which could explain why you observed faster convergence. |
@DiamondGlassDrill Merging now works at a limited resolution without manually resizing, and the typos are fixed. #27 |
@EasternJournalist thank you for the information. I have a couple of questions:
Looking forward to your guidance. Thank you in advance! |
@sctrueew The jagged edges are caused by the image's low resolution. As you are visualizing the point map as a mesh grid connecting adjacent pixels, these artifacts are inevitable since they correspond to individual pixel sizes. To achieve a smoother view, you might consider visualizing it as a point cloud instead. We're still working on expanding MoGe’s applications, including SLAM and video reconstruction. Since MoGe is an open-source project under the MIT license, you’re welcome to adapt it to meet your project's needs. You may find some information in this issue #6. We appreciate your understanding and cooperation. |
@EasternJournalist
As otherwise the decorator didn't work in \MoGe\utils3d\utils.py |
@EasternJournalist , I have another question for you. Currently, I load an HDR 360 image onto a sphere, and everything works perfectly fine. After that, I process it through your panorama pipeline and generate the depth map. My question is: should I overlay the depth map back onto a sphere? Or, in the case of a room, would it be better to work with a cube format instead?
I know you talked about this part of possible Cube structuring of a room in another thread. Did you find some time to code it already by chance? Will try to find as well some time to check your steps. Thanks in advance. |
@DiamondGlassDrill Thanks for the quick fix solution! I am sorry that I forgot to sync the utils3d submodule. The missing decorator "no_warnings" is now added. |
@DiamondGlassDrill I don't quite get how the panorama depth map is visualized on a flat plane. The panorama depth map "depth.exr" is supposed to be multiplied with a UV sphere MoGe/scripts/infer_panorama.py Line 289 in 95f6204
Given the following input image the point cloud result saved in mesh.ply should look like this from the top view Is this effect what you expected? |
@EasternJournalist excellent indeed - works now perfectly, did some multiplication errors, as you pointed out above! |
Hi,
I have a 360 panorama image. How can I display it in 3D?
The text was updated successfully, but these errors were encountered: