vital Well, for anyone interested, I think I figured it out:
#go through and for each detection find a corresponding packet to run recognition on
for det, rec in zip(packet.detections, packet.nnData):
#emotion results are output as so:
#prob_emotion, shape: 1, 5, 1, 1
#Softmax output across five emotions
#(0 - ‘neutral’, 1 - ‘happy’, 2 - ‘sad’, 3 - ‘surprise’, 4 - ‘anger’).
#numpy uses array object to keep the data formated properly because python
#is an untyped language which makes it crash when you don't do this because it is stupid
#getFirstLayerFp16 is the on device nn detection layer which runs in fp16 mode.
#I think this gets called whenever the results have to fit in an array?
emotion_results = np.array(rec.getFirstLayerFp16())
#pick the emotion which is highest of the indices in emotion_results
emotion_name = emotions[np.argmax(emotion_results)]