{
"input": "https://replicate.delivery/mgxm/0375d10a-8374-4ef6-b9f0-d40a253b0687/18.jpeg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pii**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nohamoamary/image-captioning-with-visual-attention using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nohamoamary/image-captioning-with-visual-attention:508d006dfaff69aa9c997eb7d778c891f34777ad368ca4d3e9958b6e3abc2bd3",
{
input: {
input: "https://replicate.delivery/mgxm/0375d10a-8374-4ef6-b9f0-d40a253b0687/18.jpeg"
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pii**********************************
This is your API token. Keep it to yourself.
import replicate
Run nohamoamary/image-captioning-with-visual-attention using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nohamoamary/image-captioning-with-visual-attention:508d006dfaff69aa9c997eb7d778c891f34777ad368ca4d3e9958b6e3abc2bd3",
input={
"input": "https://replicate.delivery/mgxm/0375d10a-8374-4ef6-b9f0-d40a253b0687/18.jpeg"
}
)
# The nohamoamary/image-captioning-with-visual-attention model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/nohamoamary/image-captioning-with-visual-attention/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Pii**********************************
This is your API token. Keep it to yourself.
Run nohamoamary/image-captioning-with-visual-attention using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "nohamoamary/image-captioning-with-visual-attention:508d006dfaff69aa9c997eb7d778c891f34777ad368ca4d3e9958b6e3abc2bd3",
"input": {
"input": "https://replicate.delivery/mgxm/0375d10a-8374-4ef6-b9f0-d40a253b0687/18.jpeg"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"outputType": "object",
"properties": {
"text": {
"outputType": "text",
"inferred": false,
"outputValue": "man hikes on foggy cliff",
"typeMismatch": false
}
},
"inferred": false,
"outputValue": {
"text": "man hikes on foggy cliff"
},
"typeMismatch": false
}{
"id": "3mekk6icijf33ccccdhh45oo4a",
"model": "nohamoamary/image-captioning-with-visual-attention",
"version": "508d006dfaff69aa9c997eb7d778c891f34777ad368ca4d3e9958b6e3abc2bd3",
"input": {
"input": "https://replicate.delivery/mgxm/0375d10a-8374-4ef6-b9f0-d40a253b0687/18.jpeg"
},
"logs": "2022-01-23 20:31:00.725074: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudnn.so.8\n2022-01-23 20:31:01.363218: I tensorflow/stream_executor/cuda/cuda_dnn.cc:359] Loaded cuDNN version 8101\n2022-01-23 20:31:02.099783: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublas.so.11\n2022-01-23 20:31:02.600324: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcublasLt.so.11",
"output": [
{
"text": "man hikes on foggy cliff"
}
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-01-23T20:30:27.842247Z",
"started_at": "2022-01-23T20:31:01.073305Z",
"completed_at": "2022-01-23T20:31:03.709606Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/3mekk6icijf33ccccdhh45oo4a/cancel",
"get": "https://api.replicate.com/v1/predictions/3mekk6icijf33ccccdhh45oo4a"
},
"metrics": {
"predict_time": 2.636301,
"total_time": 35.867359
}
}