Documentation | Samples | AIModelRunner
How to run Python-driven AI models on TatukGIS Viewer snapshots and raster layers.
This sample demonstrates how to execute AI inference models (like Real-ESRGAN or custom ONNX/PyTorch models via Python wrappers) directly from TatukGIS. It exports the map state, executes a Python script, parses a JSON manifest, and maps the output (raster layers or vector detections) back onto the map.
Check following guide: Running AI Models in Developer Kernel to learn how to run custom AI models in TatukGIS DK environment.
This sample illustrates use of:
| Name | Description |
|---|---|
| PythonWorkerDefault | Get or create the default singleton worker background worker that manages the TGIS_AIPythonManager internally (starts immediately). |
| TGIS_AIPythonWorker.Enqueue | Queue a job (returns immediately). |
| TGIS_AIModelCustom.Create | Instantiates a custom AI model using a Python script and dependencies. |
| TGIS_AIModel.InstallModules | Install Python modules required by the model. |
| TGIS_AIModel.Run | Run the model for the provided image. |
| TGIS_AIModelOutput.GetDetections | Returns bounding box or polygon detections. |
| TGIS_AIModelOutput.GetDetectionLayers | Returns bounding box or polygon detections converted into vector layers. |
| TGIS_AIModelOutput.GetLayers | Returns file-backed raster or vector layers generated by the model. |
| TGIS_ImageExporter.ExportToImage | Export viewer content to an image file using TGIS_PixelExportManager. |
| TGIS_ImageExporter.GetPixelSize | Calculate how a single pixel translates to geographic distance from a source viewer, based on it's visible extent and viewer component size |
This sample is available on the following platforms (click to view the source code on GitHub):