Replies: 1 comment
-
@cfscholz hello! To obtain all the pixels of an object within a segmentation mask, rather than just the outline, you should access the mask itself rather than the In the results list, each detected object should have an associated binary mask that indicates the presence of the object at each pixel location. The mask is a 2D array where the value of each element is either 0 (background) or 1 (object). By accessing this mask, you can retrieve all the pixels that belong to the object. To work with these masks, you can iterate over the detections and use the mask attribute associated with each detection. This will give you the full mask of the object, allowing you to manipulate or analyze it as needed. For more detailed information on working with segmentation masks and other tasks, please refer to the Ultralytics Docs, specifically the Segmentation section. 📘🔍 If you have further questions or need more assistance, feel free to ask. Happy coding! 😊 |
Beta Was this translation helpful? Give feedback.
-
How do I get in the results list in masks all the pixels related to an object? I currently try masks.xy, and It just gives me the outline. I would like to have all pixels of that object. Exactly how it is coloured in the segmentation output. Can someone guide me or give me a hint on how to access that? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions