Skip to content

Conversation

Vishal35198
Copy link

Added a functionality to get the class distribution -
def get_class_distribution(dataset: "DetectionDataset") -> Dict[str, int]: """ Returns a dictionary with class names as keys and sample counts as values. """ from collections import Counter all_classes = [] for det in dataset.annotations: all_classes.extend(det['class_names']) return dict(Counter(all_classes))

@CLAassistant
Copy link

CLAassistant commented Jun 4, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants