You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, thanks for reading.
I'm currently working on instance segmentation with only one class "X" and I get troubles on training model.
I have a data set with n sample, each one is a pair of an original RGB image and a binary mask image.
I've read the docs very carefully: the Detectron2's official tutorial (Use custom datasets) and the Colab Notebook with the example on training ballon dataset. Also, I searched for code to transform binary-mask datasets to COCO-form dataset, like this
But I still can't handle my case. So I was wondering if you can give me some recommendations (is there any code available? what should I do?)
Below is a sample of my data: a pair of original image and a a binary mask segmented image.
Any help is highly appreciated!
The text was updated successfully, but these errors were encountered:
@pvtien96 You can use Canny algorithm to detect edges of your masks then get location of white pixels:
import numpy as np
import cv2 as cv
img = cv.imread('PATH TO YOUR MASK IMAGE', 0)
edges = cv.Canny(img,100,200),
annotations = np.argwhere(edges == 255)
annotations contains X,Y location of your polygon. Keep in mind that this method works only if you have one object per image and there is no overlapping. In those cases you need to do more tweaking.
As our documentation says, you can provide per-pixel segmentation mask in COCO's RLE format.
You can convert a uint8 segmentation mask of 0s and 1s into an RLE by pycocotools.mask.encode(np.asarray(mask, order="F")). We'll add this to the docs as well.
❓ How to use Detectron2
Hi guys, thanks for reading.
I'm currently working on instance segmentation with only one class "X" and I get troubles on training model.
I have a data set with n sample, each one is a pair of an original RGB image and a binary mask image.
I've read the docs very carefully: the Detectron2's official tutorial (Use custom datasets) and the Colab Notebook with the example on training ballon dataset. Also, I searched for code to transform binary-mask datasets to COCO-form dataset, like this
But I still can't handle my case. So I was wondering if you can give me some recommendations (is there any code available? what should I do?)
Below is a sample of my data: a pair of original image and a a binary mask segmented image.
Any help is highly appreciated!
The text was updated successfully, but these errors were encountered: