ayoolaolafenwa / PixelLib

Visit PixelLib's official documentation https://pixellib.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with: mask_points_values=True

wisi-testpilot opened this issue · comments

Dear Ayoola Olafenwa,
thank you for the very nice PIXELLIB program.
I count and measure meteors with opencv. Now I would like to use the instance segmentation to identify meteors and artefacts, see pictures.

However with the recently introduced command mask_points_values=True I get an error message, see below.

Without mask_points_values=True the program 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 would count the colorized areas with opencv.
Thank you.
Best regards,
Wilhelm

The program:

import cv2
import pixellib
from pixellib.instance import instance_segmentation

segment_image = instance_segmentation()
segment_image.load_model("mask_rcnn_coco.h5")
seg, output = segment_image.segmentImage("k.jpg", extract_segmented_objects=True, save_extracted_objects =True,
                                         show_bboxes=True, output_image_name= "a.jpg", mask_points_values=True)

print(seg['masks'])

......

Processed image saved successfully in your current working directory.
Traceback (most recent call last):
  File "C:\Users\User\Desktop\ki\in2.py", line 22, in <module>
    seg, output = segment_image.segmentImage("k.jpg", extract_segmented_objects=True, save_extracted_objects =True,
  File "C:\Users\User\AppData\Roaming\Python\Python39\site-packages\pixellib\instance.py", line 284, in segmentImage
    for a in range(extract_mask.shape[2]):
IndexError: tuple index out of range

C:\Users\User\Desktop\ki>
21-September
demo1
Plan-instance-segmentation