It's not detecting face using image componentes, although the id is updated.
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
Hi @Vivaldo Mendes Cândido
You can check this post will be helpful. Click here
Hi @Ankit Sheshkumar Shukla,
It was not, any thing else i can try?
@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.
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
@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.
@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.
Added. Thanks @Siya