Skip to content

Commit

Permalink
efficient sample counting for grouped datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmarks authored and brimoor committed Jul 17, 2024
1 parent 800883c commit 3b11eb2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fiftyone/utils/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,10 @@ def _parse_subset_kwargs(**kwargs):

def _count_samples(sample_collection):
if sample_collection.media_type == "group":
return sum(
_count_samples(sample_collection.select_group_slices(s))
for s in sample_collection.group_slices
sample_collection = sample_collection.select_group_slices(
_allow_mixed=True
)

return sample_collection.count()


Expand Down

0 comments on commit 3b11eb2

Please sign in to comment.