I have compared MiDaS v3 and Adobe Photoshop's Neural Depth Blur filter (monocular depth maps)

preview_player
Показать описание
I have tested MiDaS v3 on google colab using a bunch of photos coming from pixabay. I have then compared the depth maps coming MiDaS v3 and those coming from Adobe Photoshop Neural Depth Blur filter (thanks to Karsten). MiDaS is as good as Photoshop, maybe even better. And it's free. Just to be clear I am talking about getting depth maps from single images (monocular depth map estimation) using Artificial Intelligence (AI), in particular, neural networks (CNNs). Because the results are so similar, Photoshop is very likely to be using MiDaS. They probably run MiDaS at various resolutions (the higher the resolution, the more details you get but the more likely you are to get wrong depths in some areas of the image) and then merge the results to get depth maps that appear more detailed than the ones MiDaS alone produces (at low resolution). You may be able to improve the depth map quality produced by MiDaS after upsampling (to match the size of the input image) using a joint bilateral filter like EPS2, EPS5, EPS7, or DMAG9b. The object boundaries should get sharper but I don't think it matters that much especially if you use the depth map for facebook 3d (which modifies the depth map anyway in the segmentation process).

Link to MiDaS v3 google colab python notebook (it says v2 but it runs v3 by default):

Link to my blogspot about getting depth maps from single images (shows the text to add to the cell to save the depth map):

Link to depthplayer (this is a web tool to visualize depth maps):

Link to my 3d software (depth map creation stuff):

To save the depth map, add this (use ctrl-v to paste):

right after:

Once I get the depth map from MiDaS, I usually do the following (in gimp):
- switch to mode = grayscale.
- scale depth map so that it matches the input image.
- apply a few iterations of Filter--Enhance--Symmetric Nearest Neighbor to sharpen the edges around objects.
- go into Colors--Levels and move the sliders (carets) so that the grayscale range of the depth map is actually between 0 and 255.
- what you can do to improve the depth map so that object boundaries in the depth map match object boundaries in the input image is to use DMAG9b. Maybe use spatial sample rate = 8 instead of 32 if DMAG9b is too aggressive.

Link to DMAG9b:
Рекомендации по теме
Комментарии
Автор

Thank you for sharing the tutorial, info and links. The presentation and your production are very interesting and well produced!

ultrablue
Автор

Very interesting comparison Ugo, thank you! Both programs are doing much better than I would have expected just a few months ago..

I can give a little bit more in info on the photoshop depth maps that I provided. Only the latest update to photoshop (22.4) has this function, in case you are looking for it in an earlier one.
Making the depth map just takes a few clicks (Filter/Neural Filters/Depth Blur, check 'Output depth map only'), and they are delivered in the original resolution of the photo, which was 1920 px on the long edge with these photos. Maps are calculated in the cloud, which took in many cases a few seconds, and never more than ca. 30 sec. It appeared like one gets down prioritized by the server if one sends a lot of jobs quickly one after the other, but I have, on other pictures made depth maps from 10 and 20 megapixel images, with no problem, in a reasonable time.

With regards to how the programs use the depth scale, I just want to add to Ugo's comment that you can easily adjust the black and white point, that you can also expand, or contract the ability to show fine differentiations in the shadow, or highlight areas simply by adjusting the gamma value.

kbqvist
Автор

The version of the midas Collab I use outputs a smaller depth map in a image output Folder, but it outputs the full resolution depth map in output Folder that this inside the monocular depth folder. I usually use it for 6000x4000 PNG files and it does a great job.

OccultDemonCassette
Автор

How can we download 3d obj with textures from the Depth Player?

eb.rar.
Автор

Very Nice Tutorial and effort to explain 2 technologies !! Yes I think MiDaS V3 gives more depth range!!

jordanlotus
Автор

Outstanding! how to download it? gltf or point cloud? Thanks!

nicolasportu
Автор

Dear Sir Please make similar step by step video on running the MiDaS V3 locally from the PC without the google Collab note book( without using internet). please give the prerequisites also to run and get the depth map. It will be very helpful.

jordanlotus
Автор

any way to change resolution of output? it saves at 200px

colemasuno
Автор

I'm considering upgrading from Midas 2 to Midas 3. You should do a comparison between the two to see if it is worth the upgrade.

WillTesler
Автор

Sir My Depth Blur filter do not work in latest photoshop, it giver error while running on cloud server. Please help. MiDaS V3 works very well as you have shown, thanks again.

jordanlotus
Автор

Salut je trouve ton boulot très inspirant !💛
je ne sais pas pourquoi, le DepthPlayer fait que crasher sur mon ordi, il n'arrive pas a rendre le model 3D...
Est ce que ton "3D software" pour Windows inclue les fonctionnalité de DepthPlayer ?

bloomp
Автор

is it possible to get a full resolution depth map?

miracle_boy_menny