YOLOv7-Pytorch-Segmentation
YOLOv7-Pytorch-Segmentation copied to clipboard
How to get area of segmented objects
Does anybody know how to calculate area if each segmented object?
Do you mean the segmented object pixel area or the area of segmented object in real world scale?
One of the output of the model are masks, which are binary images, represented by a boolean numpy array. You can use the sum() method of numpy to count the number of white pixels, that number corresponds to the pixels that your model assingned to a certain object. This is the area you are looking for.