Reference for ultralytics/models/yolo/classify/predict.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/classify/predict.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.yolo.classify.predict.ClassificationPredictor
Bases: BasePredictor
A class extending the BasePredictor class for prediction based on a classification model.
Notes
- Torchvision classification models can also be passed to the 'model' argument, i.e. model='resnet18'.
Example
Source code in ultralytics/models/yolo/classify/predict.py
postprocess
Post-processes predictions to return Results objects.
Source code in ultralytics/models/yolo/classify/predict.py
preprocess
Converts input image to model-compatible data type.
Source code in ultralytics/models/yolo/classify/predict.py
📅 Created 1 year ago ✏️ Updated 2 months ago