Defining and launching configurable pipelines#
Pipelines defined in configuration file have placeholders and the values of these placeholders can be dynamically provided via REST request. The configuration sections in a pipeline are source
, destination
and parameters
.
Note: These configurable pipelines can’t be auto started.
For example, consider the below pipeline from default config:
"pipeline": "{auto_source} name=source ! decodebin ! videoconvert ! video/x-raw,format=RGB ! udfloader name=udfloader ! gvametaconvert add-empty-results=true name=metaconvert ! gvametapublish name=destination ! appsink name=appsink",
"parameters": {
"type": "object",
"properties": {
"udfloader": {
"element": {
"name": "udfloader",
"property": "config",
"format": "json"
},
"type": "object"
}
}
}
Note: Refer to this tutorial and this section for configuration file
Refer this page for detailed instructions on how to define configurable pipelines and launch them using REST command.
{auto_source}
provides source abstraction to specify the source at the time of submitting REST request making pipelines flexible as they the same pipeline can be reused different source types like file, RTSP, webcam etc. To learn more on source abstraction and different supported types, refer to this section
gvametapublish
provides options to send metadata/frame to a chosen destination. For example, metadata can be sent to file, MQTT/Kafka messages brokers and frame can be sent over RTSP/WebRTC for streaming.
To learn more on setting metadata destination, refer to this section.
To learn more on setting frame destination, refer to this section.
parameters
are an optional section (JSON object) within a pipeline definition and are used to specify which pipeline properties are configurable. To learn more about pipeline parameters, refer to this section
Here is a sample REST request for the default pipeline which has placeholders for source
, destination
and parameters
. A video file within the container is specified as source, file is set as metadata destination, RTSP is specified for frame destination and the UDF config parameters are provided.
curl localhost:8080/pipelines/user_defined_pipelines/pallet_defect_detection -X POST -H 'Content-Type: application/json' -d '{
"source": {
"uri": "file:///home/pipeline-server/resources/videos/warehouse.avi",
"type": "uri"
},
"destination": {
"metadata": {
"type": "file",
"path": "/tmp/results.jsonl",
"format": "json-lines"
},
"frame": {
"type": "rtsp",
"path": "pallet-defect-detection"
}
},
"parameters": {
"udfloader": {
"udfs": [
{
"name": "python.geti_udf.geti_udf",
"type": "python",
"device": "CPU",
"visualize": "true",
"deployment": "./resources/models/geti/pallet_defect_detection/deployment",
"metadata_converter": "null"
}
]
}
}
}'