Skip to content

v0.3.14

Compare
Choose a tag to compare
@fcakyon fcakyon released this 07 May 00:01
· 445 commits to main since this release
0c5a34c
  • 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
    }
}