Skip to content

Commit

Permalink
Update image.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks authored Mar 14, 2019
1 parent e2f73fd commit 40a4d90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imantics/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ def add(self, annotation, category=None):

height, width = annotation.array.shape[:2]
if width == self.width and height == self.height:
annotation = Annotation.from_mask(annotation, category, annotation)
annotation = Annotation.from_mask(annotation, image=self, category=category)
else:
raise ValueError('Cannot add annotaiton of size {} to image of size {}'\
.format(annotation.array.shape, (self.height, self.width)))

if isinstance(annotation, BBox):
annotation = Annotation.from_bbox(annotation, category, annotation)
annotation = Annotation.from_bbox(annotation, image=self, category=category)

if isinstance(annotation, Polygons):
annotation = Annotation.from_polygons(annotation, category, annotation)
annotation = Annotation.from_polygons(annotation, image=self, category=category)

annotation.set_image(self)
annotation.index(self)
Expand Down

0 comments on commit 40a4d90

Please sign in to comment.