Sahi

Latest version: v0.11.19

Safety actively analyzes 682361 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 13 of 16

0.3.17

- improve .stats (85):

python
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):

python
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)

0.3.15

- add get_area_filtered_coco method to Coco class (75):

python
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):
python
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)

0.3.14

- add stats property for Coco class (70)

python
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
}
}

0.3.12

- improve coco to yolov5 conversion (68)

0.3.11

- fix coco subsampling and category updating (64)
- increase test coverage (64)

0.3.10

- fix yolo export (62)

Page 13 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.