-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to print the segmentation mask value# #28
Comments
Thank you @whoafridi. The results return boloean values of masks by default. You can convert the mask values to integer if you want to and easily access the mask values only by using this modified code below. import pixellib
from pixellib.instance import custom_segmentation
seg = custom_segmentation()
seg.inferConfig(num_classes= 2,class_names=["BG", "butterfly", "squirrel"])
seg.load_model("Nature_model_resnet101.h5")
segvalues, output = seg.segmentImage("sample.jpg", show_bboxes=True)
#Access the mask values only and convert the boolean mask values to integer
mask_values = segvalues['masks'].astype('int')
#It will print out the mask values as an array of 0s.
print(mask_values) |
@whoafridi If you want to integrate PixelLib with an API, it depends on you. I have created a detailed tutorial on this repo on how to use PixelLib, it is of you to choose how you want to integrate it with the API you intend to use. |
but the value is only zero . used your code [[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
...
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]] |
Yes that is the mask value nothing is wrong with it. I have commented that it will return an array of 0s as mask values when converted to integer. |
Is it possible to return the actual value instead of 0's . For my project I need that |
What do you mean? That is the value of masks. You can read this article about masks. |
Actually the mask/points have a pixel values. Can an we return the mask/polygon values? 0,1 isn't answer I guess |
@whoafridi The pixel values of the masks are returned as boolean values. You want to obtain the actual polygon points or values of the masks. |
Great. Is it release next year? |
Soon. Before next year. |
Great & thanks for responding 👍 |
@whoafridi upgrade to the latest version of pixellib using
Make use of this modified code to return the polygon points' values of the masks. import pixellib
from pixellib.instance import custom_segmentation
seg = custom_segmentation()
seg.inferConfig(num_classes= 2,class_names=["BG", "butterfly", "squirrel"])
seg.load_model("Nature_model_resnet101.h5")
#added a new parameter """mask_points_values""" to return the masks's polygon points' values
segvalues, output = seg.segmentImage("sample.jpg", show_bboxes = True, mask_points_values=True)
print(segvalues['masks']) |
The returned polygon points' values would show results like this below;
|
Amazing & thank you for great success in the upcoming time . Take care |
You are welcome. |
Dear ayoolaolafenwa Thank you for the very nice program. 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? My program:
......
|
May be late in the party but this might help someone.
|
Great 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 ??
output mask is Flase not get the value. Let me know please
The text was updated successfully, but these errors were encountered: