Reduce nr. of elements of ModelNet dataset #5225
-
Hello, I was trying to shrink ModelNet by reducing the number of elements in the dataset since I'm working on google Colab. Basically I want a fixed nr. of elements for each class (say 20). Is there any way to do it which is reproducible besides pre_filtering? I tried to write my own pre_filter function but it does not work (and I am also not sure about reproducibility). Here is the function (and the error):
Error:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
My guess here would be that your dataset has no elements after filtering, but it's a bit hard to tell. Do you have a full example to reproduce the issue? By the way this approach is for filtering |
Beta Was this translation helpful? Give feedback.
-
Besides via data_list = []
num_classes = defaultdict(lambda: 0)
for data ind dataset:
if num_classes[data.y] < 20:
data_list.append(data)
num_classes[data.y] += 1 |
Beta Was this translation helpful? Give feedback.
Besides via
pre_filter
, you can also do this post-processing: