> ## Documentation Index
> Fetch the complete documentation index at: https://imsdkdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Depth Estimation

> QIM SDK supported models for Depth Estimation

***

<Tabs>
  <Tab title="TFLite Runtime">
    <div style={{overflowX:"auto",borderRadius:"10px",boxShadow:"0 2px 12px rgba(50,83,220,0.10)",overflow:"hidden"}}>
      <table style={{width:"100%",borderCollapse:"collapse",fontSize:"0.85rem",border:"2px solid #3253DC"}}>
        <colgroup>
          <col style={{width:"40px"}} />

          <col style={{width:"220px"}} />

          <col style={{width:"100%"}} />
        </colgroup>

        <thead>
          <tr>
            <th style={{backgroundColor:"#3253DC",color:"#ffffff",border:"1px solid #000000",padding:"10px 8px",textAlign:"center",letterSpacing:"0.05em",width:"40px"}}>No.</th>
            <th style={{backgroundColor:"#3253DC",color:"#ffffff",border:"1px solid #000000",padding:"10px 8px",textAlign:"center",letterSpacing:"0.05em",width:"220px"}}>Model Name</th>
            <th style={{backgroundColor:"#3253DC",color:"#ffffff",border:"1px solid #000000",padding:"10px 8px",textAlign:"center",letterSpacing:"0.05em"}}>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td rowSpan={2} style={{border:"1px solid #e2e8f0",padding:"8px",textAlign:"center",verticalAlign:"middle",width:"40px"}}>1</td>
            <td style={{border:"1px solid #e2e8f0",padding:"8px",textAlign:"left",verticalAlign:"middle",width:"180px"}}><a href="https://aihub.qualcomm.com/iot/models/depth_anything" target="_blank" style={{color:"#3253DC",fontWeight:600}}>Depth-Anything</a></td>
            <td style={{border:"1px solid #e2e8f0",padding:"8px",color:"#555",fontSize:"0.82rem",verticalAlign:"middle"}}>Foundation model for monocular depth estimation on diverse scenes.</td>
          </tr>

          <tr>
            <td colSpan={2} style={{border:"1px solid #e2e8f0",padding:"4px",verticalAlign:"top",width:"100%"}}>
              <Accordion title="Steps to Run on QIMSDK">
                <Accordion title="🟡 Float32 - Model Precision">
                  <Steps>
                    <Step title="Download Required Files">
                      | File                                                                                                                                                   | Save as                       |
                      | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------- |
                      | [Model](https://aihub.qualcomm.com/iot/models/depth_anything)                                                                                          | depth\_anything\_float.tflite |
                      | <a href="../labels/monodepth.json" download="monodepth.json">monodepth.json</a>                                                                        | monodepth.json                |
                      | <a href="https://github.com/qualcomm/sample-apps-for-qualcomm-linux/raw/refs/heads/main/qualcomm-linux/artifacts/videos/demo_samples/">Input video</a> | ai\_demo\_sample.mp4          |

                      <Note>
                        If any downloaded file is a `.zip` archive, extract it on your host machine before copying:
                        `unzip filename.zip`
                      </Note>
                    </Step>

                    <Step title="Copy Files to Device">
                      <CodeGroup>
                        ```bash SCP (SSH) theme={null}
                        # Replace $HOME to the appropriate device path before running the commands.
                        # For QLI:    /root
                        # For Ubuntu: /home/ubuntu
                        # Modify this based on your platform and ensure files are copied to the correct location on the device.

                        ssh <user>@<device-ip> "mkdir -p $HOME/{models,labels,media,media/output}"
                        scp depth_anything_float.tflite  <user>@<device-ip>:$HOME/models/
                        scp monodepth.json               <user>@<device-ip>:$HOME/labels/
                        scp ai_demo_sample.mp4    <user>@<device-ip>:$HOME/media/
                        ```
                      </CodeGroup>
                    </Step>

                    <Step title="Connect to device">
                      <CodeGroup>
                        ```bash SCP (SSH) theme={null}
                        # Run from your host machine — replace <user> and <device-ip>
                        ssh <user>@<device-ip>
                        ```
                      </CodeGroup>
                    </Step>

                    <Step title="Set Environment Variables">
                      ```bash Qualcomm Linux theme={null}
                      export MODEL_NAME=depth_anything_float.tflite
                      export LABELS_NAME=monodepth.json
                      export SRC_VIDEO_NAME=ai_demo_sample.mp4
                      ```
                    </Step>

                    <Step title="Run the Pipeline">
                      ```bash theme={null}
                      gst-launch-1.0 -v --gst-debug=2 \
                      filesrc location=$HOME/media/$SRC_VIDEO_NAME ! qtdemux ! queue ! h264parse ! \
                      v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! tee name=split \
                      split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! video/x-raw,format=NV12 ! queue ! waylandsink sync=false fullscreen=true \
                      split. ! queue ! videoscale ! videoconvert ! qtimlvconverter ! queue ! \
                      qtimltflite delegate=gpu model=$HOME/models/depth_anything_float.tflite ! queue ! \
                      qtimlpostprocess module=midas-v2 labels=$HOME/labels/monodepth.json ! video/x-raw,width=320,height=180 ! queue ! mixer.
                      ```
                    </Step>
                  </Steps>
                </Accordion>
              </Accordion>
            </td>
          </tr>

          <tr>
            <td rowSpan={2} style={{border:"1px solid #e2e8f0",padding:"8px",textAlign:"center",verticalAlign:"middle",width:"40px"}}>2</td>
            <td style={{border:"1px solid #e2e8f0",padding:"8px",textAlign:"left",verticalAlign:"middle",width:"180px"}}><a href="https://aihub.qualcomm.com/iot/models/depth_anything_v2" target="_blank" style={{color:"#3253DC",fontWeight:600}}>Depth-Anything-V2</a></td>
            <td style={{border:"1px solid #e2e8f0",padding:"8px",color:"#555",fontSize:"0.82rem",verticalAlign:"middle"}}>Improved foundation depth model with finer detail and accuracy.</td>
          </tr>

          <tr>
            <td colSpan={2} style={{border:"1px solid #e2e8f0",padding:"4px",verticalAlign:"top",width:"100%"}}>
              <Accordion title="Steps to Run on QIMSDK">
                <Accordion title="🟡 Float32 - Model Precision">
                  <Steps>
                    <Step title="Download Required Files">
                      | File                                                                                                                                                   | Save as                           |
                      | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------- |
                      | [Model](https://aihub.qualcomm.com/iot/models/depth_anything_v2)                                                                                       | depth\_anything\_v2\_float.tflite |
                      | <a href="../labels/monodepth.json" download="monodepth.json">monodepth.json</a>                                                                        | monodepth.json                    |
                      | <a href="https://github.com/qualcomm/sample-apps-for-qualcomm-linux/raw/refs/heads/main/qualcomm-linux/artifacts/videos/demo_samples/">Input video</a> | ai\_demo\_sample.mp4              |

                      <Note>
                        If any downloaded file is a `.zip` archive, extract it on your host machine before copying:
                        `unzip filename.zip`
                      </Note>
                    </Step>

                    <Step title="Copy Files to Device">
                      <CodeGroup>
                        ```bash SCP (SSH) theme={null}
                        # Replace $HOME to the appropriate device path before running the commands.
                        # For QLI:    /root
                        # For Ubuntu: /home/ubuntu
                        # Modify this based on your platform and ensure files are copied to the correct location on the device.

                        ssh <user>@<device-ip> "mkdir -p $HOME/{models,labels,media,media/output}"
                        scp depth_anything_v2_float.tflite  <user>@<device-ip>:$HOME/models/
                        scp monodepth.json                  <user>@<device-ip>:$HOME/labels/
                        scp ai_demo_sample.mp4       <user>@<device-ip>:$HOME/media/
                        ```
                      </CodeGroup>
                    </Step>

                    <Step title="Connect to device">
                      <CodeGroup>
                        ```bash SCP (SSH) theme={null}
                        # Run from your host machine — replace <user> and <device-ip>
                        ssh <user>@<device-ip>
                        ```
                      </CodeGroup>
                    </Step>

                    <Step title="Set Environment Variables">
                      ```bash Qualcomm Linux theme={null}
                      export MODEL_NAME=depth_anything_v2_float.tflite
                      export LABELS_NAME=monodepth.json
                      export SRC_VIDEO_NAME=ai_demo_sample.mp4
                      ```
                    </Step>

                    <Step title="Run the Pipeline">
                      ```bash theme={null}
                      gst-launch-1.0 -v --gst-debug=2 \
                      filesrc location=$HOME/media/$SRC_VIDEO_NAME ! qtdemux ! queue ! h264parse ! \
                      v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! tee name=split \
                      split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! video/x-raw,format=NV12 ! queue ! waylandsink sync=false fullscreen=true \
                      split. ! queue ! videoscale ! videoconvert ! qtimlvconverter ! queue ! \
                      qtimltflite delegate=gpu model=$HOME/models/depth_anything_float.tflite ! queue ! \
                      qtimlpostprocess module=midas-v2 labels=$HOME/labels/monodepth.json ! video/x-raw,width=320,height=180 ! queue ! mixer.
                      ```
                    </Step>
                  </Steps>
                </Accordion>
              </Accordion>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </Tab>
</Tabs>
