Get access to webcam in laptop

Hi every one.

I’m attempting to use the camera on my laptop to capture an image in order to classify it directly rather than uploading it from the laptop.

So I am trying to capture a image and pass it to callable function in googlecolab so that it can predict.

I get to know that we can give access to camera in anvil by using image/|video/;capture=camera
and input type=“file” accept=“image/*” capture=“camera” these coding lines.

But I am not sure were to keep these lines are how to get access to my camera using anvil in laptop.

Can any one help me with this as i am new to anvil.

Clone link:
https://classify-fruit-and-vegetables.anvil.app

If you do a forum search on webcam, there’s a Show & Tell post that demonstrates how to capture an image from the camera. What part of that isn’t working for you? The more specifics you can give, the better someone will be able to help.

To be more specific i want to take a screen shot or capture some thing through webcam and pass it to callable function in googlecolab. The one in Show & Tell more like start and stop the cam.

The one in Show & Tell puts the camera image onto a canvas. Have you looked at the canvas documentation to see if you can get a media object out of it? If you can, you’d be able to pass the media object to any server function.

There are also forum posts that talk about using the file loader component. Have you tried that?

If you want more specific help, you’ll need to share a clone link. The link you originally shared was a link to the live app, not a clone link, so nobody can use that to look at the code you’ve already tried.