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

# UniMatch 

The `UniMatch` implements a wrapper for the UniMatch model, which estimates optical flow in videos using a multi-scale transformer-based approach.

<ResponseField name="class UniMatch()">
  <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 False.
  </ResponseField>
</ResponseField>

<ResponseField name="def run()">
  <ResponseField name="video_input" type="str" required="True">
    The link to the video or the path to the video/image directory.
  </ResponseField>

  <ResponseField name="mode" type="str" default="video">
    The mode of input, either 'video' or 'image'.
  </ResponseField>

  <ResponseField name="Returns" type="list">
    The optical flow maps for the input video or images.
  </ResponseField>
</ResponseField>

<RequestExample>
  ```python Inference Call theme={null}
  from grid.model.perception.optical_flow.gmflow import UniMatch
  car = AirGenCar()

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

  video_input =  "https://huggingface.co/datasets/pranay-ar/test/resolve/main/all_ego.mp4"

  model = UniMatch(use_local = False)
  result = model.run(video_input, mode='video')
  ```
</RequestExample>

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

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