简体   繁体   中英

How to invoke webcam in watson conversation service?

I'm having my Chatbot made on Watson Assistant service on IBM Cloud, and it's working fine. I have a python project that can invoke webcam for facial recognition. This process of facial recognition takes about 2.5 mins: 1- Invoking the Webcam, 2- Take the correct facial photo of the user, 3- Return the facial recognition result.

My question is that how to invoke the webcam for the facial recognition through Watson Assistant conversation through python API on Cloud function call through Webhook? Whilst the timeout of Waston Assistant webhook is about 30 seconds?

Any help is appreciated. Thanks

thanks for the question.

At this point, your application may be getting too complex to build through the IBM Watson Assistant user interface. Ideally when a call takes more than a few seconds to respond, you won't want to rely on an open Webhook connection, but rather have your application hosted on a server that communicates with Watson Assistant through an API. As an example, here is the node.js integration .

If you do want to continue to use the Watson Assistant UI, you can create a Cloud Function for your webhook that accomplishes two tasks. One task is to start your Webcam and hand off the data to your facial recognition service, and the second can return a status of whether that service has completed successfully (and the text of the facial recognition service.)

Here is one way to make that work through the UI:

在此处输入图像描述

So in this case we'll call our endpoint from Start Webcam, and also from our second child node. In the middle, we'll have a delay so that we don't hammer our function too hard:

在此处输入图像描述

Make sure to set a variable to differentiate your status check to differentiate it from your webcam kickoff:

在此处输入图像描述

However, the details of this will depend on what function you use for your webhook. Let me know if you have any questions about that part of the implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM