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

# DPVO 

The `DPVO` class is a wrapper for the DPVO model, which estimates camera poses from RGB images using a deep learning approach.

<ResponseField name="class DPVO()">
  <ResponseField name="use_local" type="boolean" default="True">
    If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to True.
  </ResponseField>

  <ResponseField name="calib" type="np.ndarray" default="false">
    The camera calibration matrix of shape $(4,)$. Defaults to `np.array([320, 320, 320, 240])`.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  Uses DPVO to predict the camera pose for the given RGB image relative to the previous one.
  If this is the first image, initializes the pose estimation routine.

  <ResponseField name="image" type="np.ndarray" required="True">
    The input RGB image of shape $(M,N,3)$.
  </ResponseField>

  <ResponseField name="Returns" type="np.ndarray">
    The predicted pose as a 1x6 tensor containing X, Y, Z positions and R, P, Y orientation.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.perception.vo.vo_dpvo import DPVO
  car = AirGenCar()

  # We will be capturing an image from the AirGen simulator 
  # and run model inference on it.

  img =  car.getImage("front_center", "rgb").data

  model = DPVO(use_local = True)
  result = model.run(image=img)
  ```
</RequestExample>

<Tabs>
  <Tab title="License">
    This code is licensed under the MIT License.
  </Tab>

  <Tab title="Source">
    [https://github.com/princeton-vl/DPVO](https://github.com/princeton-vl/DPVO)
  </Tab>
</Tabs>
