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
I've been trying to preprocess my Google Open Images Dataset for detectron2 to detect saucers. The thing with the dataset is that the mask size and image size are different. So when I try to plot the images, I get wrong segmentations like this.
I've narrowed this down to be the issue from the preprocessing logs, where this is the final values I get for the dictionary
{'file_name': 'validation/0483900e6425b41a.jpg', 'image_id': '0483900e6425b41a', 'height': 1024, 'width': 683, 'annotations': [{'bbox': array([ 24.17699, 187.28024, 657.31195, 824.63715], dtype=float32), 'bbox_mode': <BoxMode.XYXY_ABS: 0>, 'category_id': 0, 'segmentation': {'size': [1000, 667], 'counts': b'WR...
As you can see, the 'height': 1024, 'width': 683 of the image and 'size': [1000, 667] of the segmentation are different.
I've tried plotting the images using this code, but I keep getting differences in the segmentation mask size and image size.
from detectron2.utils.visualizer import ColorMode
dataset_dicts = val_img_dicts
for d in random.sample(dataset_dicts, 3):
im = cv2.imread(d["file_name"])
v = Visualizer(im[:, :, ::-1],
metadata=val_metadata,
scale=1,
instance_mode=ColorMode.IMAGE_BW # remove the colors of unsegmented pixels
)
v = v.draw_dataset_dict(d)
plt.imshow(cv2.cvtColor(v.get_image()[:, :, ::-1], cv2.COLOR_BGR2RGB))
plt.show()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been trying to preprocess my Google Open Images Dataset for detectron2 to detect saucers. The thing with the dataset is that the mask size and image size are different. So when I try to plot the images, I get wrong segmentations like this.
I've narrowed this down to be the issue from the preprocessing logs, where this is the final values I get for the dictionary
{'file_name': 'validation/0483900e6425b41a.jpg', 'image_id': '0483900e6425b41a', 'height': 1024, 'width': 683, 'annotations': [{'bbox': array([ 24.17699, 187.28024, 657.31195, 824.63715], dtype=float32), 'bbox_mode': <BoxMode.XYXY_ABS: 0>, 'category_id': 0, 'segmentation': {'size': [1000, 667], 'counts': b'WR...
As you can see, the 'height': 1024, 'width': 683 of the image and 'size': [1000, 667] of the segmentation are different.
I've tried plotting the images using this code, but I keep getting differences in the segmentation mask size and image size.
How do I fix this issue?
Beta Was this translation helpful? Give feedback.
All reactions