DepthPro2-WebGPU / README.md
byoussef's picture
Depth Pro 2 in the browser on WebGPU
8ddb12f verified
|
Raw History Blame Contribute Delete
1.92 kB
metadata
title: Depth Pro 2 WebGPU
emoji: 📷
colorFrom: blue
colorTo: red
sdk: static
pinned: false
license: other
license_name: apple-amlr
license_link: https://github.com/apple-aiml-research/ml-depth-pro-2/blob/main/LICENSE_MODEL
short_description: Depth from one photo, in your browser on WebGPU
models:
  - byoussef/DepthPro2-litert
tags:
  - depth-estimation
  - webgpu
  - litert

Depth Pro 2 on WebGPU

Depth Pro 2 running in the browser: the LiteRT files on WebGPU, with LiteRT.js. Photos and camera frames stay on the device.

  • Pick a sample, upload a photo or start the camera, then drag the divider between the photo and its depth.
  • Model S (98 MB) or B (387 MB), in float16 or float32. float16 needs the GPU's shader-f16 feature; without it the page stays in float32.
  • "Depth in meters" adds the field-of-view model (95 MB), which estimates the focal length. Point at the picture to read a distance.

It needs WebGPU: Chrome, Edge or Firefox on a computer. Safari 27.2 runs it and returns wrong depth.

The whole demo is index.html.

License

Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement, which allows research use only. The demo and the converted files are unofficial, and Apple does not endorse them.

The sample photos are CC0, from Wikimedia Commons: macaques by Davidvraju, kitchen by NeONBRAND, forest path by Zed Can77 and mountain reservoir by Paul Gilmore.