Instructions to use leeyunjai/yolo11-cls-mask with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use leeyunjai/yolo11-cls-mask with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("leeyunjai/yolo11-cls-mask") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
How to Use
To use this model in your project, follow the steps below:
1. Installation
Ensure you have the ultralytics library installed, which is used for YOLO models:
pip install ultralytics
# class
with_mask
without_mask
2. Load the Model
You can load the model and perform detection on an image as follows:
from ultralytics import YOLO
# Load the model
model = YOLO("./mask-11x-224.pt")
# Perform detection on an image
results = model("image.png", imgsz=224)
# Display or process the results
results.show() # This will display the image with detected objects
3. Model Inference
The results object contains bounding boxes, labels (e.g., numbers or operators), and confidence scores for each detected object.
Access them like this:
# View results
for r in results:
print(r.probs) # print the Probs object containing the detected class probabilities
- Downloads last month
- 8
