Image captioning using image url only without blob?

#23
by nappystock - opened

Hi!, how can I use image captioning when I only have image url? the constraint is:

  1. no need to open/read an image (ie. no with open("/content/demo.jpg", "rb") as image_file...)
  2. and using curl.

here's what I did (this works because it's an image blob):

curl https://api-inference.huggingface.co/models/Salesforce/blip-image-captioning-large \
        -X POST \
        --data-binary '@pilates.jpg' \
        -H "Authorization: Bearer ${HF_API_TOKEN}"
# [{"generated_text": "there is a man doing a handstand on a rock in the woods"}]

But, is there any way to do a request where I only have image url?

Sign up or log in to comment