Skip to content

DL Classifier (f8.dl.classifier)

ONNXRuntime image classifier service (no tracking).

  • Service class: f8.dl.classifier
  • Version: 0.0.1
  • Source directory: f8/dl/classifier
  • Tags: onnx, vision, classification

When to Use

  • Use f8.dl.classifier when you need category predictions rather than detection boxes.
  • It fits graphs where a target region is already known and the next question is "what class is this?"
  • It is often the right tool for scene-state recognition or ROI-level classification.

Common Wiring Patterns

  • A common setup sends an ROI from a detector or tracker into the classifier.
  • If you classify full frames, make sure the model was trained for that style of input.
  • Route classification results into f8.pyengine, Text Viz, or UI logic.

Pitfalls / Gotchas

  • Classification quality depends heavily on model choice and correct preprocessing.
  • If the output feels unstable, verify the input crop before blaming the classifier.
  • Thresholds should be chosen from observed score distributions, not guessed in isolation.

Service Reference

How to Run

pixi run -e onnx f8pydl_classifier
  • Workdir: ../../../../
  • Environment overrides: none

Typical Inputs / Outputs

  • Data inputs: none
  • Data outputs: classifications, monitor
  • Commands: none

Service State Fields

Name Access Required On Node Schema Description
shmName rw true true string / default= Video SHM mapping name (e.g. shm.implayer.video).
weightsDir rw true true string / default=services/f8/dl/weights Directory containing .yaml + .onnx model files. Reset to the default relative path when exporting publish JSON.
modelId rw true true string / default= Model id selected from weightsDir (ignored if modelYamlPath is set).
modelYamlPath rw true false string / default= Optional explicit model yaml path (overrides modelId). Cleared when exporting publish JSON.
ortProvider rw true true string / enum[auto, cuda, cpu] / default=auto auto prefers CUDAExecutionProvider when available.
autoDownloadWeights rw true false boolean / default=True When model file is missing, download from onnxUrl in model yaml.
inferEveryN rw true true integer / default=1 Run model inference every N frames (>=1).
topK rw true true integer / default=5 Number of top classes to emit.
availableModels ro true false array[string] List of model ids discovered from weightsDir.
loadedModel ro true false string / default= Current loaded model id/task.
ortActiveProviders ro true false string / default= JSON list of active ONNX Runtime providers for this session.
lastError ro true false string / default= Last runtime error string (best-effort).
active rw true false boolean / default=True Service lifecycle state (activate/deactivate).
svcId ro true false string Readonly: current service instance id (svcId).

Key Fields That Matter

  • shmName (Video SHM, rw): Video SHM mapping name (e.g. shm.implayer.video). Schema: string / default=.
  • weightsDir (Weights Dir, rw): Directory containing .yaml + .onnx model files. Reset to the default relative path when exporting publish JSON. Schema: string / default=services/f8/dl/weights.
  • modelId (Model Id, rw): Model id selected from weightsDir (ignored if modelYamlPath is set). Schema: string / default=.
  • modelYamlPath (Model YAML Path, rw): Optional explicit model yaml path (overrides modelId). Cleared when exporting publish JSON. Schema: string / default=.
  • ortProvider (ONNX Runtime Provider, rw): auto prefers CUDAExecutionProvider when available. Schema: string / enum[auto, cuda, cpu] / default=auto.
  • autoDownloadWeights (Auto Download Weights, rw): When model file is missing, download from onnxUrl in model yaml. Schema: boolean / default=True.
  • inferEveryN (Infer Every N Frames, rw): Run model inference every N frames (>=1). Schema: integer / default=1.
  • topK (Top K, rw): Number of top classes to emit. Schema: integer / default=5.

Service Commands

None

Service Data Input Ports

None

Service Data Output Ports

Name Required On Node Schema Description
classifications true true object{frameId, model, schemaVersion, top1, ...} Classification output in schema f8visionClassifications/1.
monitor true false object{active, alive, cpu, error, ...} Unified runtime monitor snapshots (health/resource/perf/error).

Operators

None

  • No bundled scenario references this node yet.