Avoid `IndexError` when no face is detected

#5
by cbensimon HF staff - opened

Currently the Space sometimes errors on :

Traceback (most recent call last):
  File "/home/user/app/app.py", line 61, in generate_image
    faceid_embed = torch.from_numpy(faces[0].normed_embedding).unsqueeze(0)
IndexError: list index out of range

This change should display an error modal instead

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment