Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve .stats #85

Merged
merged 5 commits into from
May 8, 2021
Merged

improve .stats #85

merged 5 commits into from
May 8, 2021

Conversation

fcakyon
Copy link
Collaborator

@fcakyon fcakyon commented May 8, 2021

fixes #81

Get dataset stats:

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

@fcakyon fcakyon added the enhancement New feature or request label May 8, 2021
@fcakyon fcakyon added this to the v0.3.16 milestone May 8, 2021
@fcakyon fcakyon self-assigned this May 8, 2021
@fcakyon fcakyon merged commit 02c50e9 into main May 8, 2021
@fcakyon fcakyon deleted the patch81 branch May 8, 2021 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve .stats
1 participant