Install Depth Model

In this guide we will go through the steps required to install the depth model ViroReact relies on for providing depth to none LiDAR iOS devices.

Download Depth Model

In ViroReact 2.51.0 we introduced depth for none LiDAR iOS devices. In order to use depth-based features such as occlusion on iOS devices that do not support LiDAR, you will need to download the CoreML depth model. Below is a link to download a .zip containing the required model. You will need to ensure this model is bundled into your iOS project in order to make use of this within your app.

Within the .zip there's also an Expo Plugin you can use to simplify bundling the model with your Expo app.

Download Depth Model →

Using The Depth Expo Plugin

If you are using Expo you can simplify bundling the model in your project by using the withDepthModel.js Expo plugin which is available in the same folder as the depth model.

To use this plugin, drag and drop the withDepthModel.js file into the plugins folder within your Expo project. We also recommend storing the DepthPro model in your assets folder (./assets/DepthPro.mlmodelc.

In your app.json/app.config.js file add the following configuration for the withDepthModel plugin.

[
	"./plugins/withDepthModel", 
	{ 
    "modelPath": "./assets/DepthPro.mlmodelc" 
	}
],

More Detailed Guide

If you need a more detailed guide for setting this up you can check out this guide on our blog.