from grid.model.perception.ttc.optexp import OpticalExpansioncar = AirGenCar()# We will be capturing an image from the AirGen simulator # and run model inference on it.img = car.getImage("front_center", "rgb").datamodel = OpticalExpansion(use_local = False)result = model.run(rgbimage=img)print(result.shape)
The OpticalExpansion class provides core functionality for this module.
Routes inference to GRID-Cortex if available; otherwise, uses local inference.Args:
rgbimage (np.ndarray): The input RGB image.Returns:
dict: The output containing TTC, occupancy, logarithmic motion in depth, and optical flow.
from grid.model.perception.ttc.optexp import OpticalExpansioncar = AirGenCar()# We will be capturing an image from the AirGen simulator # and run model inference on it.img = car.getImage("front_center", "rgb").datamodel = OpticalExpansion(use_local = False)result = model.run(rgbimage=img)print(result.shape)
from grid.model.perception.ttc.optexp import OpticalExpansioncar = AirGenCar()# We will be capturing an image from the AirGen simulator # and run model inference on it.img = car.getImage("front_center", "rgb").datamodel = OpticalExpansion(use_local = False)result = model.run(rgbimage=img)print(result.shape)
Assistant
Responses are generated using AI and may contain mistakes.