get_target_formatter¶
- class flash.core.data.utilities.classification.get_target_formatter(targets, labels=None, num_classes=None, add_background=False)[source]¶
Get the
TargetFormatter
object to use for the given targets.- Parameters
labels¶ (
Optional
[List
[str
]]) – Optionally providelabels
/num_classes
instead of inferring them.num_classes¶ (
Optional
[int
]) – Optionally providelabels
/num_classes
instead of inferring them.add_background¶ (
bool
) – IfTrue
, a background class will be inserted as class zero iflabels
andnum_classes
are being inferred.
- Return type
- Returns
The target formatter to use when formatting targets.