I have trained a Yolo V11 for a segmentation task on face skin issues , there are multiple skin issues which it can predict on same model , my concern is can i show these predictions seperatly like if it has 2 annotations of dark circles as well as wrinkles , i want to show them seperatly one for dark circle , and other for wrinkles (attached a image for sample)
Great question! You can definitely display predictions for different skin issues separately using the same YOLOv11 model. Since your model is already trained to recognize multiple classes, you can filter the results based on the class labels during inference. Here’s a simple way to achieve this:
Run Inference: Use the predict() method on your model to get the results.
Filter Results: Iterate through the results and separate them based on the class labels (e.g., dark circles, wrinkles).
Here’s a quick code snippet to illustrate this:
from ultralytics import YOLO
# Load your trained model
model = YOLO("path/to/your/model.pt")
# Run inference on an image
results = model.predict("path/to/image.jpg")
# Separate results by class
for result in results:
for box in result.boxes:
class_id = int(box.cls)
if class_id == 0: # Assuming 0 is the class ID for dark circles
print("Dark Circles:", box)
elif class_id == 1: # Assuming 1 is the class ID for wrinkles
print("Wrinkles:", box)
Make sure to adjust the class IDs to match those in your model. This way, you can display or process each type of skin issue separately without needing to train separate models.
For more details, you might want to check out the Predict Mode documentation for additional insights on working with results.
I hope this helps! If you have any more questions, feel free to ask. Happy coding!
Each instance is going to be shown as an individual object if that was how they were annotated for training. You’d have to either update the annotations or add some customs logic for particular cases to combine them into a single object using the extrema points of the objects, but I would not recommend this for numerous reasons.