AMB82-mini : Face Detection & Emotion Detection

Based on RTSPFaceDetection.ino,
how do I create the following add into FDPostProcess ?

  1. img = CV2.crop(frame)
  2. img = CV2.rgb2gray(img)
  3. img = CV2.resize(img, (48, 48))
  4. emo = NNemotiondetection.predict(img)

my emotion detection model is trained by
kaggle.com/rkuo2000/fer2013

Pretrained README
file : fer2013_cnn.h5 (1.26MB)
total params = 103,143
input_shape = (48,48,1)
test accuracy = 54.89%

( minimize model size, also reduce accuracy! )