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>)
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: str | None = 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: str | None = None
GstElement instance name. Arbitrary string, useful for identifying pipeline elements.