提交 80f26b39 编写于 作者: S Shivam K. Thakkar 提交者: Waleed

Made compatible to new version of VIA JSON format

VIA has changed JSON formatting in later versions. Now instead of a dictionary, "regions" has a list, see the issue #928
上级 2ec88a35
......@@ -120,7 +120,10 @@ class BalloonDataset(utils.Dataset):
# Get the x, y coordinaets of points of the polygons that make up
# the outline of each object instance. There are stores in the
# shape_attributes (see json format above)
polygons = [r['shape_attributes'] for r in a['regions'].values()]
if type(a['regions']) is dict:
polygons = [r['shape_attributes'] for r in a['regions'].values()]
else:
polygons = [r['shape_attributes'] for r in a['regions']]
# load_mask() needs the image size to convert polygons to masks.
# Unfortunately, VIA doesn't include it in JSON, so we must read
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册