Skip to content

16 bit depthmap extra details #125

Open
@AugmentedRealityCat

Description

@AugmentedRealityCat

The video example shown on this reddit post is more detailed than what we get even though it was made with the stable-diffusion-webui-depthmap-script extension.
https://www.reddit.com/r/StableDiffusion/comments/11eiqij/partial_3d_model_from_sd_images_still_in_a_very/

Here is the beginning of that video to give you an idea.
https://user-images.githubusercontent.com/114955776/222047336-ac8facd1-9f3a-4c50-af74-b3ad115c2bc6.mp4

According to the poster, the only difference in code is one that allows the system to keep the whole 16 bits of details, while the current implementation reduces it to 8 bit (which is the color depth used by the Stable Diffusion code). That would mean that even though the file we get is encoded as a 16 bit greyscale PNG, that image would not be showing the depth map data in full details.

That difference in code would be the removal of a division by 255, which I found on the following line (346):

img = cv2.cvtColor(np.asarray(inputimages[count]), cv2.COLOR_BGR2RGB) / 255.0

And here is the link to the post where I read about that code modification:

yeah but you lose ton of detail , try to edit the depthmap script in python
find the X-value/ 255 and remove the 255 to get the full 16bit depthmap
there is so much detail
https://www.reddit.com/r/StableDiffusion/comments/11eiqij/comment/jaf4s1l/?utm_source=share&utm_medium=web2x&context=3

Does this make sense and is there any other modification required to get even more detailed 16 bit depthmaps, as per the Reddit example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions