how to print the segmentation mask value#
See original GitHub issueGreat packages! amazed! So, my question is that I’m going through your tutorial got the code but didn’t work for me. I want to print the Instance segmentation mask value ?? my output code is given below Another one is how to serve this through an API ??
import pixellib
from pixellib.instance import custom_segmentation
import cv2
instance_seg = custom_segmentation()
instance_seg.inferConfig(num_classes= 2, class_names= ["BG", "butterfly", "squirrel"])
instance_seg.load_model("/content/mask_rcnn_models/mask_rcnn_model.027-0.335725.h5")
segmask, output = instance_seg.segmentImage("/content/Nature/test/butterfly (10).jpg", show_bboxes= True, output_image_name="e_out.jpg")
cv2.imwrite("img.jpg", output)
print(segmask.get('rois'))
for item in segmask.items():
print(item)
output mask is Flase not get the value. Let me know please
[[ 42 32 172 232]]
('rois', array([[ 42, 32, 172, 232]], dtype=int32))
('class_ids', array([1], dtype=int32))
('scores', array([0.98511064], dtype=float32))
('masks', array([[[False],
[False],
[False],
...,
[False],
[False],
[False]],
[[False],
[False],
[False],
...,
[False],
[False],
[False]],
[[False],
[False],
[False],
...,
[False],
[False],
[False]],
...,
[[False],
[False],
[False],
...,
[False],
[False],
[False]],
[[False],
[False],
[False],
...,
[False],
[False],
[False]],
[[False],
[False],
[False],
...,
[False],
[False],
[False]]]))
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Image Segmentation Python | Implementation of Mask R-CNN
An introduction to image segmentation. In this article learn about Mask R-CNN framework for image segmentation and implementation of mask ...
Read more >How to Generate a Mask from Semantic Image Segmentation ...
To get the output mask I use the Tensorflow Tutorial for Image ... the hue of each RGB value and map yellowish things...
Read more >Converting annotations to object segmentation mask images
An object segmentation mask image uses the multiple channels to encode both class and instance information. In this mask format we multiply the...
Read more >How to Cut Out Object Segmentations from Detectron2
This video is a response to some questions we received regarding how to use the mask outputs of an instance segmentation neural net....
Read more >Instance Segmentation MASK R-CNN | with Python and Opencv
source code and files: https://pysource.com/2021/05/18/instance- segmentation - mask -r-cnn-with-python-and-opencv/In this tutorial, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Dear ayoolaolafenwa
Thank you for the very nice program. I want to use the Instance segmentation mask values to count and meassure the objects, but with the recently introduced command mask_points_values=True I get an error message, see below.
Without mask_points_values=True it works, but I only get [False False False].
Alternatively, is it possible to generate an output without the original image overlay, like it is possible in the semantic segmentation? You may implement the command: overlay = False in the Instance Segmentation. Then I will investigate the areas with Opencv.
My program:
…
Amazing & thank you for great success in the upcoming time . Take care