ZoeDepth can estimate depth from images [Can be used in various scenes]

MLBoy
Jan 3, 2024

--

  • Depth can be estimated in meters from images of various indoor and outdoor scenes.

how to use

Insall

Depending on the version of timm and torch, a runtime error may occur, so use the following.

pip install timm==0.6.7
pip install torch==2.0.1
git clone https://github.com/isl-org/ZoeDepth.git
cd ZoeDepth

Operation check

python sanity.py

model road

import torch
from zoedepth.utils.misc import get_image_from_url, colorize
zoe = torch.hub.load(".", "ZoeD_N", source="local", pretrained=True)
zoe = zoe.to('cuda')

execution

import cv2
from PIL import Image
img = Image.open("image.jpg")
depth = zoe.infer_pil(img)
colored_depth = colorize(depth)
cv2.imwrite('zoe_depth.png',colored_depth)

🐣

I’m a freelance engineer.
Work consultation
Please feel free to contact us with a brief development description.
rockyshikoku@gmail.com

I am creating applications using machine learning and AR technology.

I send machine learning / AR related information.

GitHub

Twitter
Medium

--

--

MLBoy
MLBoy

No responses yet