Skip to content

Commit

Permalink
add ignore_negative_samples argument to Coco.from_coco_dict_or_path
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored May 10, 2021
1 parent 36ec40f commit fefbf30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sahi/utils/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def merge(self, coco, desired_name2id=None, verbose=1):
)

@classmethod
def from_coco_dict_or_path(cls, coco_dict_or_path, desired_name2id=None, image_dir=None, remapping_dict=None, mp=False):
def from_coco_dict_or_path(cls, coco_dict_or_path, desired_name2id=None, image_dir=None, remapping_dict=None, ignore_negative_samples=True, mp=False):
"""
Creates coco object from COCO formatted dict or COCO dataset file path.
Expand All @@ -933,6 +933,8 @@ def from_coco_dict_or_path(cls, coco_dict_or_path, desired_name2id=None, image_d
Base file directory that contains dataset images. Required for merging and yolov5 conversion.
remapping_dict: dict
{1:0, 2:1} maps category id 1 to 0 and category id 2 to 1
ignore_negative_samples: bool
If True ignores images without annotations in all operations.
mp: bool
If True, multiprocess mode is on.
Should be called in 'if __name__ == __main__:' block.
Expand Down

0 comments on commit fefbf30

Please sign in to comment.