PyFuncElement
- class savant.config.schema.PyFuncElement(module, class_name, kwargs=None, dev_mode=False, element='pyfunc', element_type=None, version='v1', name=None, properties=<factory>, dynamic_properties=<factory>)
A pipeline element that will use an object implementing
BasePyFuncPlugin
to apply custom processing to gstreamer buffers.For example,
- element: pyfunc module: module.pyfunc_implementation_module class_name: PyFuncImplementationClass
- __call__(*args, **kwargs)
Calls resolved PyFunc implementation if its a subclass of
BasePyFuncCallableImpl
, otherwise no-op.
- check_reload()
Checks if reload is needed and reloads in case it is.
- element_type: Optional[str] = None
Element type/subtype, can be defined as a substring of the
element
.For example,
detector
in- element: nvinfer@detector
- property full_name
Full element name.
- property instance: BasePyFuncImpl
Returns resolved PyFunc implementation.
- load_user_code()
Load (or reload) the user module/class specified in the PyFunc fields. It’s necessary to call this at least once before starting the pipeline.
- name: Optional[str] = None
GstElement instance name. Arbitrary string, useful for identifying pipeline elements.
- version: str = 'v1'
Element version, can be defined as a substring of the
element
.For example,
v1
in- element: nvinfer@detector:v1
- dynamic_properties: Dict[str, DynamicGstProperty]
GstElement properties that can be updated during runtime.