> ## 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.

# LightGlue 

The `LightGlue` model computes point matches
between two images using SuperPoint and LightGlue.

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

<ResponseField name="def run()">
  <ResponseField name="image0" type="np.ndarray" required="True">
    Input RGB image 1 of shape $(M,N,3)$.
  </ResponseField>

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

  <ResponseField name="Returns" type="List">
    List of point correspondences (matches) between the images.
  </ResponseField>

  <ResponseField name="points0" type="np.ndarray">
    Feature points detected in image 1 of shape $(K,2)$.
  </ResponseField>

  <ResponseField name="points1" type="np.ndarray">
    Feature points detected in image 2 of shape $(K,2)$.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.perception.matching.glightglue import LightGlue
  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
  img1 = img.copy()

  model = LightGlue(use_local = False)
  matches1, points0_1, points1_1  = model.run(img, img1)
  ```
</RequestExample>

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

  <Tab title="Source">
    [https://github.com/cvg/LightGlue](https://github.com/cvg/LightGlue)
  </Tab>
</Tabs>
