| hf_caption_image | R Documentation |
Generate short image captions. This uses a vision-capable chat model by default because the public 'hf-inference' provider did not expose a broadly available image-to-text captioning model during verification.
hf_caption_image(
image,
prompt = "Write a short, factual caption for this image.",
model = hf_default_model("caption_image"),
max_tokens = 80,
token = NULL,
endpoint_url = NULL,
...
)
image |
Image input: a local file path, URL, raw vector, or vector/list of paths/URLs. |
prompt |
Prompt used to request the caption. |
model |
Character string. Vision-capable chat model ID. Default: "google/gemma-3-4b-it". |
max_tokens |
Integer. Maximum tokens to generate. |
token |
Character string or NULL. API token for authentication. |
endpoint_url |
Character string or NULL. A custom Inference Endpoint URL. |
... |
Additional arguments passed to |
A tibble with columns: image, caption.
hf_describe_image
## Not run:
hf_caption_image("cat.png")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.