[Trivial?] How to change alphabetical class order when using from_folder?

Hi! I was wondering if there is quick way to change the class order when using function from_folder from imageDataBunch. In documentation the training dataset (train) has clas1 and clas2.

By default, they will get indices 0 and 1. How could pass a list so that clas1 = good and clas2 = bad? e.g. [good, bad] Notice that I am changing the name and not using the alphabetical order. If not possible with from_folder other solutions are also very welcomed.

1 Like

did you every find a solution?

You would have to edit the labelling function, i.e. re-writing it. As a quick fix you can simply append a number in front of your label class.

1 Like

Hey Gloria,
I just saw you can pass a list of your classes and the order will be the order the DataBunch will use. https://docs.fast.ai/vision.data.html#ImageDataBunch.from_folder