Which label corresponds to which index in the ouput vector

Hi,

@risk of asking the obvious:

I am training a simple classifier and use the generated tflite file in my own application.

What would be the simplest way to figure out which output index corresponds to which label.

I thought, the ei_classifier_inferencing_categories variable in the model_variables.h file of the exported c++ library would give me the right order … but seems like not …

Best Regards
step

Hello @step22,

From the ei_impulse_result_t you can get the label:

Regards,

Louis

Hi Louis,

thanks for your reply, but this actually does not answer my question.

my labels cannot be in the sdk, as they are somehow custom to my project.

I see this char * [] in model-parameters/model_variables.h which basically holds my cathegories:

const char* ei_classifier_inferencing_categories[] = { “cat1”, “cat2”, “cat3”, “cat4” };

but the mapping of the index in the output tensor of my network to the position of the label in the char*[] is kind of random.

I wonder how this is handled in your library …

Best Regards
step