295 for feat in features:
296 temp = []
297 for i in range(feat.shape[0]):
298 temp_fv = feat[i, :]
if one of the class folder has only 1 sample, feat will be an 1d array of shape (, 136). And line 398 will give an error as it tries to access 1d array with 2d indices (feat[i, :])
I propose the following fix
for feat in features:
if feat.ndim == 1: # this class has only 1 sample
feat = feat.reshape((1, feat.shape[0]))
temp = []
for i in range(feat.shape[0]):
temp_fv = feat[i, :]
if one of the class folder has only 1 sample, feat will be an 1d array of shape (, 136). And line 398 will give an error as it tries to access 1d array with 2d indices (feat[i, :])
I propose the following fix