Skip to content

Commit

Permalink
Made compatible to new version of VIA JSON format
Browse files Browse the repository at this point in the history
VIA has changed JSON formatting in later versions. Now instead of a dictionary, "regions" has a list, see the issue matterport#928
  • Loading branch information
skt7 authored and waleedka committed Sep 21, 2018
1 parent 2ec88a3 commit 80f26b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/balloon/balloon.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def load_balloon(self, dataset_dir, subset):
# 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
Expand Down

0 comments on commit 80f26b3

Please sign in to comment.