Wednesday, May 12, 2021

 How to get names of all classes in a dataset generated by ImageDataGenerator ? 


By using ImageDataGenerator.class_indices attribute



classlabels = test_ds_gen.class_indices
print(classlabels)
print(classlabels.keys())


{'daisy': 0, 'dandelion': 1, 'roses': 2, 'sunflowers': 3, 'tulips': 4}
dict_keys(['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips'])

No comments:

Post a Comment

 using Microsoft.AspNetCore.Mvc; using System.Xml.Linq; using System.Xml.XPath; //<table class="common-table medium js-table js-stre...