So I was working on instance segmentation but now I am just able to segment 1 of the object from the image.
So I run the below codes to get my output:
image2 = mpimg.imread(path_to_new_image)
# Run object detection
print(len([image2]))
results = model.detect([image2], verbose=1)
# Display results
ax = get_ax(1)
r2 = results[0]
visualize.display_instances(image2, r2['rois'], r2['masks'], r2['class_ids'],
dataset.class_names, r2['scores'], ax=ax, title="Predictions3")
And the output I get is as followed: 1
Then I run the following codes to crop the image based on the mask, but I only able to crop one of it...
So how can I crop both of them, instead of 1 mask only?