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