This repo branch contains the implementations of
- Depth map estimation using depth-anything.
- Meshgrid generation.
-
Installation:
pip install -q opencv-python torch torchvision matplotlib timm scipy ipywidgets
If encounters any dependencies conflict, please refer to pip_freeze.txt for full list of package versions.
-
Place one or more input images in your input folder.
-
Run the model with
CUDA_VISIBLE_DEVICES=$GPU_ID python run_depth-anything.py --input $INPUT --output_path $OUTPUT --model_type $model_type --grayscale
where
<model_type>is chosen from depth-anything/Depth-Anything-V2-Large-hf, depth-anything/Depth-Anything-V2-Large, depth-anything/Depth-Anything-V2-Small-hf, depth-anything/Depth-Anything-V2-Small, depth-anything/Depth-Anything-V2-Base-hf, depth-anything/Depth-Anything-V2-Base, LiheYoung/depth-anything-large-hf, LiheYoung/depth-anything-large, LiheYoung/depth-anything-small-hf, LiheYoung/depth-anything-small, LiheYoung/depth-anything-base-hf, LiheYoung/depth-anything-base, depth-anything/Depth-Anything-V2-Metric-Indoor-Large-hf. -
The resulting grayscale depth maps are written to the
$OUTPUTfolder. Please be aware that the input images will be padded and resized to 1024x1024 (or 512x512, can be adjusted at request) for the trade-off depthmap quality and processing speed.
-
Set input depth map path, e.g., $INPUT_DEPTH_MAP=$INPUT_DIR/$INPUT_FILENAME.
-
Call
create_mesh_grid($INPUT_DEPTH_MAP)increate_meshgrid.py. -
The resulting meshgrids are stored as
.npzfiles under the directory of depthmaps.