cog icon indicating copy to clipboard operation
cog copied to clipboard

Pass a local image in a deployed mode.

Open alkhawli opened this issue 3 years ago • 4 comments
trafficstars

I am not being able to pass a local image using curl, I tried to edit the data to the following:

{ "input": { "image": "C:/../../input.jpg" }, "output_file_prefix": "." }

But unfortunately it didnt work, I am getting

"msg": "'c' is not a valid URL scheme. 'data', 'http', or 'https' is supported.",

alkhawli avatar Aug 03 '22 10:08 alkhawli

This doesn't work yet unfortunately. I've filed a ticket for it here: https://github.com/replicate/cog/issues/693

You can pass files with the command line like this:

cog predict -i image=@C:/../../input.jpg

Why are you using the API rather than the CLI, out of interest? Are you integrating it with an application?

bfirsh avatar Aug 03 '22 15:08 bfirsh

Thanks @bfirsh . The cog predict works great. I just got stuck in the deployment testing. I was able to run the docker image and expose it to the localhost. The last step is to test the curl post and provide an image that is saved locally.

I am checking the possibility of deploying this to an industrial edge device that is connected to a camera and serve the model using the API.

alkhawli avatar Aug 03 '22 16:08 alkhawli

Same here. If the command line supports the local file, why not the docker?

tommy-qichang avatar Sep 13 '23 06:09 tommy-qichang