TensorFlow Object Detection only outputs "Face"?

I’m using an H7 Plus with a built-in example in OpenMV IDE (Machine Learning → TensorFlow → object detection). It’s detecting things very well, but the Serial console only outputs “face” when something is detected, even dogs or cars. What could be the reason? Does this part of the code change the output of the classes of objects detected?

colors = [ # Add more colors if you are detecting more than 7 types of classes at once.
    (255,   0,   0),
    (  0, 255,   0),
    (255, 255,   0),
    (  0,   0, 255),
    (255,   0, 255),
    (  0, 255, 255),
    (255, 255, 255),

I’m making a face detection pan/tilt mechanism and this model seems to work better than the Haar Cascade one. However, it not only detect faces but also draws green circles around other objects. Is there any way to change this? Can I also make it only detect one object at once?

Beginner here, any suggestions are appreciated :slight_smile:

It should only detect faces.

The colors are just there to map the class outputs from the model to a color. I.e. that table works for models that do 1-7 classes.

Typically, you want to use Edge Impulse to train a custom CNN for your application. This will give you the best results.

So I should be able to reduce that table to just two rows, without changing the behavior of this particular model? I tried deleting a few rows and the output circle changed colors.

Do I need to flash the firmware of my board in order to use a custom model?

Thanks for the reply!!

Yeah, the model only outputs face or no face so it’s only using two rows.

As for updating the model, Edge Impulse gives you two options.

  1. Load the network from disk. This requires a lot of RAM.
  2. Build the firmware for your board with the mode in the firmware. This requires less RAM but means the model can’t be very large.
1 Like

Ah I see,
does this page detail the two options you mentioned?Edge Impulse OpenMV

what do you mean by load the network from disk? It requires a lot of RAM on the computer or the board?
I have a 32gb SD card on my camera, is it possible to load the model from the card instead?


When the model is loaded from disk it has to go into RAM. Unless you have an H7 Plus camera then that means you’re putting it into the limited 400Kb onboard.

So, flash is preferred since you don’t have to load it from RAM as it’s in the application address space as a static C array.

1 Like