Skip to content

Cannot run inference video #3

@HoangTienDuc

Description

@HoangTienDuc

Hello @zye1996 . Thank for your awesome work.
I try to run your inference/inference_video.py, but got 2 error:

First is:

list index out of range

  File "/Storage/ducht/face/Mobilefacenet-TF2-coral_tpu/inference/FaceRecognizer.py", line 89, in __init__
    self.rec_output_index = self.interpreter.get_output_details()[1]['index']
  File "/Storage/ducht/face/Mobilefacenet-TF2-coral_tpu/inference/inference_video.py", line 87, in <module>
    face_recognizer = FaceRecognizer(REC_MODEL_PATH, tpu=args.coral_tpu)

I decide comment

self.mask_output_index = self.interpreter.get_output_details()[0]['index']

And change index of self.rec_output_index from 1 to 0
self.rec_output_index = self.interpreter.get_output_details()[1]['index']

It work. But i got second error

Second is:

Cannot set tensor: Got value of type UINT8 but expected type FLOAT32 for input 331, name: input_1 

File "/Storage/ducht/face/Mobilefacenet-TF2-coral_tpu/inference/FaceRecognizer.py", line 106, in face_recognize
    self.interpreter.set_tensor(self.rec_input_index, aligned_norm)
  File "/Storage/ducht/face/Mobilefacenet-TF2-coral_tpu/inference/inference_video.py", line 145, in <module>
    feature, mask = face_recognizer.face_recognize(aligned, mask=True)

How to fix these error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions