Skip to content

Releases: obss/sahi

v0.3.19

15 May 02:23
31bc7e1
Compare
Choose a tag to compare
  • refactorize slicing, faster coco indexing (#95)

v0.3.18

10 May 04:42
5fe936c
Compare
Choose a tag to compare
  • utilize ignore_negative_samples property (#90):

Filter out images that does not contain any annotation

from sahi.utils.coco import Coco
# set ignore_negative_samples as False if you want images without annotations present in json and yolov5 exports
coco = Coco.from_coco_dict_or_path("coco.json", ignore_negative_samples=True)
  • fix typo in get_area_filtered_coco (#89)

v0.3.17

08 May 13:42
e61adde
Compare
Choose a tag to compare
  • improve .stats (#85):
from sahi.utils.coco import Coco

# init Coco object
coco = Coco.from_coco_dict_or_path("coco.json")

# get dataset stats
coco.stats
{
  'num_images': 6471,
  'num_annotations': 343204,
  'num_categories': 2,
  'num_negative_images': 0,
  'num_images_per_category': {'human': 5684, 'vehicle': 6323},
  'num_annotations_per_category': {'human': 106396, 'vehicle': 236808},
  'min_num_annotations_in_image': 1,
  'max_num_annotations_in_image': 902,
  'avg_num_annotations_in_image': 53.037243084530985,
  'min_annotation_area': 3,
  'max_annotation_area': 328640,
  'avg_annotation_area': 2448.405738278109,
  'min_annotation_area_per_category': {'human': 3, 'vehicle': 3},
  'max_annotation_area_per_category': {'human': 72670, 'vehicle': 328640},
}
  • add category based annotation area filtering (#86):
# filter out images with seperate area intervals per category
intervals_per_category = {
  "human": {"min": 20, "max": 10000},
  "vehicle": {"min": 50, "max": 15000},
}
area_filtered_coco = coco.get_area_filtered_coco(intervals_per_category=intervals_per_category)

v0.3.15

07 May 19:44
c8509b4
Compare
Choose a tag to compare
  • add get_area_filtered_coco method to Coco class (#75):
from sahi.utils.coco import Coco
from sahi.utils.file import save_json

# init Coco objects by specifying coco dataset paths and image folder directories
coco = Coco.from_coco_dict_or_path("coco.json")

# filter out images that contain annotations with smaller area than 50
area_filtered_coco = coco.get_area_filtered_coco(min=50)

# filter out images that contain annotations with smaller area than 50 and larger area than 10000
area_filtered_coco = coco.get_area_filtered_coco(min=50, max=10000)

# export filtered COCO dataset
save_json(area_filtered_coco.json, "area_filtered_coco.json")
  • faster yolov5 conversion with mp argument (#80):
# multiprocess support
if __name__ == __main__:
  coco = Coco.from_coco_dict_or_path(
    "coco.json",
    image_dir="coco_images/"
    mp=True
  )
  coco.export_as_yolov5(
    output_dir="output/folder/dir",
    train_split_rate=0.85,
    mp=True
  )
  • update torch and mmdet versions in workflows (#79)
  • remove optional dependencies from conda (#78)

v0.3.14

07 May 00:01
0c5a34c
Compare
Choose a tag to compare
  • add stats property for Coco class (#70)
from sahi.utils.coco import Coco

# init Coco object
coco = Coco.from_coco_dict_or_path("coco.json")

# get dataset stats
coco.stats
{
    'avg_annotation_area': 2448.405738278109,
    'avg_num_annotations_in_image': 53.037243084530985,
    'max_annotation_area': 328640,
    'max_num_annotations_in_image': 902,
    'min_annotation_area': 3,
    'min_num_annotations_in_image': 1,
    'num_annotations': 343204,
    'num_annotations_per_category': {
        'human': 106396,
        'vehicle': 236808
    },
    'num_categories': 2,
    'num_images': 6471,
    'num_images_per_category': {
        'human': 5684,
        'vehicle': 6323
    }
}

v0.3.12

04 May 23:27
97da6e3
Compare
Choose a tag to compare
  • improve coco to yolov5 conversion (#68)

v0.3.11

01 May 11:12
b25bf6c
Compare
Choose a tag to compare
  • fix coco subsampling and category updating (#64)
  • increase test coverage (#64)

v0.3.10

01 May 10:01
c48e9c3
Compare
Choose a tag to compare
  • fix yolo export (#62)

v0.3.9

01 May 02:15
0acf928
Compare
Choose a tag to compare
  • faster Coco merging and category updating (#59)

v0.3.8

28 Apr 22:53
18083cf
Compare
Choose a tag to compare
  • increase coco split and yolo export speeds (#58)
  • reduce json export size (#57)
  • make multiprocess call optional (#55)