ClassificationValidator
Bases: BaseValidator
Source code in ultralytics/yolo/v8/classify/val.py
__init__(dataloader=None, save_dir=None, pbar=None, args=None, _callbacks=None)
Initializes ClassificationValidator instance with args, dataloader, save_dir, and progress bar.
Source code in ultralytics/yolo/v8/classify/val.py
finalize_metrics(*args, **kwargs)
Finalizes metrics of the model such as confusion_matrix and speed.
Source code in ultralytics/yolo/v8/classify/val.py
get_dataloader(dataset_path, batch_size)
Builds and returns a data loader for classification tasks with given parameters.
Source code in ultralytics/yolo/v8/classify/val.py
get_desc()
get_stats()
Returns a dictionary of metrics obtained by processing targets and predictions.
init_metrics(model)
Initialize confusion matrix, class names, and top-1 and top-5 accuracy.
Source code in ultralytics/yolo/v8/classify/val.py
plot_predictions(batch, preds, ni)
Plots predicted bounding boxes on input images and saves the result.
Source code in ultralytics/yolo/v8/classify/val.py
plot_val_samples(batch, ni)
Plot validation image samples.
Source code in ultralytics/yolo/v8/classify/val.py
preprocess(batch)
Preprocesses input batch and returns it.
Source code in ultralytics/yolo/v8/classify/val.py
print_results()
Prints evaluation metrics for YOLO object detection model.
update_metrics(preds, batch)
Updates running metrics with model predictions and batch targets.
Source code in ultralytics/yolo/v8/classify/val.py
val
Validate YOLO model using custom data.
Source code in ultralytics/yolo/v8/classify/val.py
Created 2023-04-16, Updated 2023-05-17
Authors: Glenn Jocher (3)