15
Views
8
Comments
Solved
[Facial Recognition] Face Detection not working for image componentes only video
facial-recognition
Reactive icon
Forge asset by Victor Abreu
Application Type
Reactive
Service Studio Version
11.55.20 (Build 64140)

It's not detecting face using image componentes, although the id is updated.

2025-06-07 16-46-54
Victor Abreu
Solution

Hi Vivaldo, like Siya said, the component uses readyState to initialize the face search. My mistake — when I created the component, I only used it for video elements, so I didn’t include support for img elements to start the face search. I’ve just added the image validation. 


And the img size:


Now it's working for both.
Hope it help

2025-04-10 12-15-03
Ankit Sheshkumar Shukla

Hi @Vivaldo Mendes Cândido 


You can check this post will be helpful. Click here 


UserImage.jpg
Vivaldo Mendes Cândido

Hi @Ankit Sheshkumar Shukla,

It was not, any thing else i can try?



2019-01-07 16-04-16
Siya
 
MVP

@Vivaldo Mendes Cândido : Please check if the demo application provided with the component works as expected. Additionally, if you’ve built a sample application where you're encountering the issue, kindly share it. Someone from the community with relevant experience may be able to assist you.

UserImage.jpg
Vivaldo Mendes Cândido

Hi @Siya,

Thanks for your reply.

I'm using the demo application provided, it currently only working using the camera as source input, it states that i can change the source id to a different one but it's not behaving as expected after the change.

Find attached the demo app with the above mentioned modification.

Kindly Regards,

VC


cameraerro.oml
2019-01-07 16-04-16
Siya
 
MVP

@Vivaldo Mendes Cândido : I was looking at the JS code of this component especially startPrepareCanvas inside the faceApiFunctions. 

The readyState property is applicable only to <video> and <audio> elements, not to images. This explains why it doesn't work when an <img> element is passed. Perhaps the component owner, @Victor Abreu, can provide further clarification.

2025-06-07 16-46-54
Victor Abreu
Solution

Hi Vivaldo, like Siya said, the component uses readyState to initialize the face search. My mistake — when I created the component, I only used it for video elements, so I didn’t include support for img elements to start the face search. I’ve just added the image validation. 


And the img size:


Now it's working for both.
Hope it help

2019-01-07 16-04-16
Siya
 
MVP

@Victor Abreu : Thanks for sharing the fix. I noticed that the original code included a null check for faceApivideo, which is missing in the updated version. You might want to add it back to avoid potential crashes when the DOM element isn’t found.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.