The repository demonstrates the implementation of immersive 360 depth (image and video) in WebXR powered by A-Frame, Three.js and Depth Anywhere. It has the following:
A-Frame component can be found in "a-frame-component" folder. Usage example of the component is given below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>A-Frame Depth 360 Component</title>
<script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/akbartus/360-Depth-in-WebXR/a-frame-component/depth-360-component.js"></script>
</head>
<body>
<a-scene>
<a-entity rotation="90 0 0" depth-360="colorImageURL: https://cdn.glitch.global/35f43dae-1ed9-4eff-b068-3100ca885bb4/1.jpg; depthImageURL: https://cdn.glitch.global/35f43dae-1ed9-4eff-b068-3100ca885bb4/1depth.jpg; spread: 10; pointSize: 10; skip: 1; colored: true">
<a-entity camera="fov: 75" wasd-controls look-controls position="0 0 1"></a-entity>
<a-box color="orange" position="0 0 -5"></a-box>
</a-entity>
<a-sky color="#000"></a-sky>
</a-scene>
</body>
</html>
In order to use the component, make sure to include depth-360 attribute.
The component has the following schema:
Three.js example implementation can be found in "threejs" folder.
The example 360 image and 360 depth both were taken from "Depth Anywhere: Enhancing 360 Monocular Depth Estimation via Perspective Distillation and Unlabeled Data Augmentation - Neurips 2024" project.
In order to generate own 360 depth for 360 image, please visit: https://albert100121.github.io/Depth-Anywhere/
Please note: Make sure original image and generated depth both have the same size.
To be added soon.
The project is powered by A-Frame, Three.js and Depth Anywhere project.
To see the component in action, visit the following page: https://depth360-component.glitch.me/