[Classify]: Allow inference on dirs and videos #9003
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows running classification inference on dirs.
![Screenshot 2022-08-17 at 11 32 06 PM](https://user-images.githubusercontent.com/15766192/185210352-c307d06b-e7ae-4597-a21b-423fce085a49.png)
Usage:
python classify/predict.py --source data/images
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Enhanced the image classification inference to support various input types.
📊 Key Changes
classify/predict.py
to handle file, directory, URL, and glob patterns as input sources.cv2
) from the main inference script.LoadImages
class to theclassify/predict.py
to handle different input types.classify_transforms
function.--source
parameter.🎯 Purpose & Impact