** One photo ** ** High-precision 3D image ↓ Easy creation **.
I tried to easily create a high-precision 3D image with one photo [1]. (Depth can now be edited in PNG.) See the article.
here, ** Try processing depth with numpy **
Below are the papers and github.
https://arxiv.org/pdf/2004.04727.pdf Paper "3D Photography using Context-aware Layered Depth Inpainting" Meng-Li Shih1 and others
github is below. https://github.com/vt-vl-lab/3d-photo-inpainting
Processing source image Use https://pixabay.com/ja/
The original one still image.
result.
The original one still image.
result.
For the time being, set the depth value to about 20 levels? I tried to discretize it. (Excuse me, ** I'm failing as an example. I don't know the action at all ... ** See the next section for the action.)
** I tried 2 lines ** In fact, for example, should we create a meaningful function and make it work? I think there is some consideration as to whether it is better to do it in the processing phase here.
run.py
# compute
with torch.no_grad():
out = model.forward(img_input)
out = out//0.1#######add to
out = out*0.1#######add to
depth = utils.resize_depth(out, target_width, target_height)
img = cv2.resize((img * 255).astype(np.uint8), (target_width, target_height), interpolation=cv2.INTER_AREA)
From the above, the granularity has been increased to 5 times **.
out = out//0.5#######add to
out = out*0.5#######add to
I wrote editing png in the previous article, but ** I thought that the default numpy might be easier to handle **, so I gave an example of editing with numpy. (Unfortunately, it didn't lead to meaningful editing ...) If you have any comments, please.
Recommended Posts