Limit the number of images per class
andreadaou opened this issue · 2 comments
andreadaou commented
Hello,
Is there any argument in the code that let us limit the number of images per class (training images and test images)? For example, when adding a new dataset with .txt files, we need each time to modify these files to vary the number of images.
Thank you for your help !!
mmasana commented
Hi @andreadaou ,
currently there is no such argument to not over-complicate more the framework. However, you can easily define this on your main
by reducing the loader size after creating the loaders. Iterate through them and do smth like:
trn_loader[t].dataset.images = trn_loader[t].dataset.images[:MAX_NUM]
trn_loader[t].dataset.labels = trn_loader[t].dataset.labels[:MAX_NUM]
It's not the most efficient or versatile, but it quickly solves the issue.
andreadaou commented
Thank you !