AnomalibTorchInference
Python template · sinapsis_anomalib.templates.anomalib_torch_inference
Overview
PyTorch-specific inference implementation for Anomalib models.
Extends base inference to provide native PyTorch model execution.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
Terminalbash
pip install sinapsis-anomalib==1.0.0uv pip install sinapsis-anomalib==1.0.0uv add sinapsis-anomalib==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
deviceRequired
Target device for inference (either 'cuda' or 'cpu').
typing.Literal['cuda', 'cpu']
Required
Default: null
Required
Default: null
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
Optional
Default: null
model_pathRequired
str
Required
Default: null
Required
Default: null
transforms
dict
Optional
Default: null
Optional
Default: null
anomaly_area_threshold
float
Optional
Default: 100
Optional
Default: 100
Configuration example
Example from the Python docstring:
yaml
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: AnomalibTorchInference
class_name: AnomalibTorchInference
template_input: InputTemplate
attributes:
model_path: 'path/to/model.pt'
transforms: null
device: 'cuda'Show schema-based configuration skeleton
yaml
templates:
- template_name: "AnomalibTorchInference"
class_name: "AnomalibTorchInference"
attributes:
device: "<required>"
model_path: "<required>"
transforms: {}
anomaly_area_threshold: 100
Inheritance
Immediate parent:
sinapsis_anomalib.templates.anomalib_base_inference.AnomalibBaseInferenceEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.