Skip to content

Commit

Permalink
update coco utils (#40)
Browse files Browse the repository at this point in the history
* update coco utils

* update to v0.3.3
  • Loading branch information
fcakyon authored Apr 11, 2021
1 parent e734ae8 commit 3ad54d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sahi/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.2"
__version__ = "0.3.3"
14 changes: 13 additions & 1 deletion sahi/utils/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,18 @@ def add_category(self, category):

self.categories.append(category)

def add_image(self, image):
"""
Adds image to this Coco instance
Args:
image: CocoImage
"""

assert type(image) == CocoImage, "image must be a CocoImage instance"

self.images.append(image)

@classmethod
def from_coco_dict_or_path(cls, coco_dict_or_path):
"""
Expand Down Expand Up @@ -1566,7 +1578,7 @@ def add_video(self, video):
video: CocoVideo
"""

assert isinstance(video, CocoVideo), "video must be a CocoVideo instance"
assert type(video) == CocoVideo, "video must be a CocoVideo instance"

self.videos.append(video)

Expand Down

0 comments on commit 3ad54d6

Please sign in to comment.