Closed zeakey closed 1 year ago
This is because the polygon
is a scalar or something that does not have __len__
, you need to check the format of your annotations, especially the type of polygon.
This is because the
polygon
is a scalar or something that does not have__len__
, you need to check the format of your annotations, especially the type of polygon.
polygon
seems to be RLE format annotation encoded as a np.ndarray:
As mentioned in #3599 , I simply add poly2mask=False
to dict(type='LoadAnnotations', with_bbox=True, with_mask=True, poly2mask=False)
https://github.com/open-mmlab/mmdetection/blob/9596b9a4c916ae601f9a8a641c3a0ea47265abec/configs/_base_/datasets/cityscapes_instance.py#L7,
and then start training by python tools/train.py configs/cityscapes/mask_rcnn_r50_fpn_1x_cityscapes.py
.
I intend to get polygon-style targets (instead of masks) in the roi head
, this is useful in implementing many contour-based instance segmentation methods like deep-snake, polarmask.
It seems that there is some incompatibility between the polygon mask and cityscapes. Please @yhcao6 have a check on that.
The
process_polygons()
function https://github.com/open-mmlab/mmdetection/blob/9596b9a4c916ae601f9a8a641c3a0ea47265abec/mmdet/datasets/pipelines/loading.py#L268-L271 uses the buitin functionlen()
to anumpy.ndarray
object, leading to aTypeError: len() of unsized object
error.This issue is related to #3599 where I tried to output polygon-style annotations to the
FCNMaskHead
.