Documentation | Samples | AIModelRunner
Sample app for running Python-driven AI Models on TatukGIS Viewer/Layer.
What the sample shows:
What the sample shows:
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 and start it immediately. |
| TGIS_AIPythonWorker.Enqueue | Queue a job for execution on the worker thread and return immediately. |
| TGIS_AIModelCustom.Create | Instantiates a custom AI model with a Python manager, model path, script template, required modules, and placeholder tokens. |
| TGIS_AIModel.InstallModules | Installs the Python modules required by the model. |
| TGIS_AIModel.Run | Runs the model for the specified input image. |
| TGIS_AIModelOutput.GetDetections | Returns detections aggregated from all detection output items. |
| TGIS_AIModelOutput.GetDetectionLayers | Returns detections converted into vector layers. |
| TGIS_AIModelOutput.GetLayers | Returns file-backed layers produced by the AI output manifest. |
| 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 its visible extent and viewer component size. |
This sample is available on the following platforms (click to view the source code on GitHub):