Nodes/comfyui_cv/CV Class Scores Decode
ComfyUI Node

CV Class Scores Decode

Unwraps a classification model's score vector ((1, C) or (C,) from 'CV DNN Pick Output') into the top-k class labels, scores and ids. Class names come from the same labels text as the detectors ('CV Load Labels', line N = class id N). DATA only - feed 'Preview as Text' to see the ranking.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Class Scores Decode
  • scores
  • labels_out
  • scores_top
  • class_ids
  • top_label
top_k5
activationauto
labels
Categoryimage/CV/dnn

Inputs (4)

NameTypeDefaultDescription
scoresNPARRAY(1, C) or (C,) per-class scores/logits from the model (pick it out of 'DNN Forward All' with 'DNN Pick Output').
top_kINT51–1000How many of the highest-scoring classes to emit.
activationoptCOMBOauto'auto' applies softmax only when the values lie outside [0, 1] (i.e. raw logits). 'softmax'/'sigmoid' always apply, 'none' never (model already outputs probabilities).
labelsoptSTRINGClass names, one per line (line N = class id N), e.g. from 'CV Load Labels'. Blank = classes are labelled by their numeric id.

Outputs (4)

NameTypeDescription
labels_outNPARRAY(K,) string array of the top-k class labels, best first. Feed 'Preview as Text'.
scores_topNPARRAY(K,) float32 scores of the top-k classes (after the chosen activation), best first.
class_idsNPARRAY(K,) int32 class ids of the top-k classes.
top_labelSTRINGThe single best class label (top-1).