fuxiao0719 / GeoWizard

[ECCV'24] GeoWizard: Unleashing the Diffusion Priors for 3D Geometry Estimation from a Single Image

Home Page:https://fuxiao0719.github.io/projects/geowizard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to output not colored, so the maps are usable?

gituser123456789000 opened this issue · comments

How to output not colored, so the maps are usable?

I think I see in run_infer.py line 93 "Spectral" is the default colormap. What is the default color if you weren't to use a colormap? Or which would be best for use in programs that don't process the colored maps? "gray" or "binary" (depending which is white front black rear)?

Thank you for the help lines in the code, for people that don't know code to at least understand part of it

You can use (depth_pred * 65535.0).astype(np.uint16) to generate 16-bit uint png.

Thank you. I'll try this later, along with trying 32 for 32bit if that's how that works. 32bit made a significant difference when used in TilingZoeDepth for example, so hopefully 32bit output will improve the results and contrast ratio in Geowizard also.

You can use (depth_pred * 65535.0).astype(np.uint16) to generate 16-bit uint png.

I like your answer for a different reason, that let's us experiment with higher bitrates, but there's confusion with what I meant in the original post.

I meant that colored maps are not useful when using conversion programs.. when you combine the original image with the depth map to create 3D (SBS, anaglyph, cross-eyed, etc). Colored maps give inaccurate results, because most of all of the programs I know of process in a grayscale.. and usually or always in the white front black rear format.

I was wondering how to output the raw "grayscale" image, without the color added (which gives inaccurate results when converting 3D), without having to change the colormap to something like 'binary', because I'm not sure if adding a 'binary' or 'gray' colormap messes with the accuracy and contrast of the results actually produced within Geowizard prior to adding a colormap

You can use (depth_pred * 65535.0).astype(np.uint16) to generate 16-bit uint png.

Where exactly should this change be made?

I see depth_pred in run_infer.py as well as geowizard_pipeline.py

I see uint in colormap.py and geowizard_pipeline.py

I made a change in geowizard_pipeline.oy and it failed to produce an output.

For non-coders, where should this change be made? In what file and what line?

I see.. changing line 198 in geowizard_pipeline.py to:
normal_colored = (depth_pred * 65535.0).astype(np.uint16)

works..

It's black front white rear, instead of white front black rear though

normal_colored = (depth_pred * 65535.0).astype(np.uint32)

with 32.. also produced a result, but not 32 bit. Both outputs are 16bit compared to the colored map, which is 24 bit. I'd be interested in see 32bit.

I see.. changing line 198 in geowizard_pipeline.py to: normal_colored = (depth_pred * 65535.0).astype(np.uint16)

works..

It's black front white rear, instead of white front black rear though

normal_colored = (depth_pred * 65535.0).astype(np.uint32)

with 32.. also produced a result, but not 32 bit. Both outputs are 16bit compared to the colored map, which is 24 bit. I'd be interested in see 32bit.

For 32 you would need 16777216 instead of 65535

Thanks. It will be interesting to see if it makes any difference.

I previously tried 4294967295, but that gave a strange result

Thanks. It will be interesting to see if it makes any difference.

I previously tried 4294967295, but that gave a strange result

Nop, it is not usable, png doesnt support 32b.