> For the complete documentation index, see [llms.txt](https://nx.docs.scailable.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nx.docs.scailable.net/ai-manager-v6.1.4/ai-manager-plugin/advanced-configuration/external-preprocessing.md).

# External Preprocessing

The inference pipeline supports custom or proprietary pre-processing through a custom application that receives the input frame and can alter or analyze it.

Examples show how to create these applications. These applications can be created using any programming language, as long as the device can execute this program, send it messages over a Unix socket, and receive a response.

The settings tell the AI Manager how to start the application. The AI Manager automatically starts the application on startup and terminates it when the AI Manager terminates.

The external pre-processor runs as a completely independent application. The AI Manager puts no restrictions on which hardware, API's or tools this application uses. As long as this application can receive and respond to messages over a Unix socket, it is compatible.

The external pre-processing step happens before any other pre-processing is done on the frame. This means that the external pre-processor receives the original, full resolution image as it was sent to the AI Manager.

The external pre-processor receives a header message over the Unix socket describing the input frame and detailing how to connect to the shared memory segment where the frame is stored. The pre-processor can then connect to this shared memory, alter the data, or write back a new image with new dimensions. The altered data is used in the rest of the pipeline.

The AI Manager waits until the external pre-processor responds with a header message containing the new (or same) image dimensions and the new (or same) shared memory segment. Once the AI Manager receives this message, it copies the data from the shared memory segment and uses it for the rest of the inference pipeline.

## Custom External Processing

To customize this behavior, create a preprocessor to apply a mask, or a postprocessor to exclude results from a designated area.

The GitHub repository contains examples of custom preprocessors and postprocessors:

{% embed url="<https://github.com/scailable/sclbl-integration-sdk>" %}
Sclbl Integration SDK
{% endembed %}
