salesforce
/
blip
Generate image captions
Prediction
salesforce/blip:2e1dddc8Input
{ "task": "image_captioning", "image": "https://replicate.delivery/mgxm/f4e50a7b-e8ca-432f-8e68-082034ebcc70/demo.jpg" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "image_captioning", image: "https://replicate.delivery/mgxm/f4e50a7b-e8ca-432f-8e68-082034ebcc70/demo.jpg" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "image_captioning", "image": "https://replicate.delivery/mgxm/f4e50a7b-e8ca-432f-8e68-082034ebcc70/demo.jpg" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "image_captioning", "image": "https://replicate.delivery/mgxm/f4e50a7b-e8ca-432f-8e68-082034ebcc70/demo.jpg" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Caption: a woman sitting on the beach with a dog{ "completed_at": "2022-02-06T17:53:43.900562Z", "created_at": "2022-02-06T17:52:02.993876Z", "data_removed": false, "error": null, "id": "i5xhgehjkjfyhlx7dg2f5tnrti", "input": { "task": "image_captioning", "image": "https://replicate.delivery/mgxm/f4e50a7b-e8ca-432f-8e68-082034ebcc70/demo.jpg" }, "logs": null, "metrics": { "predict_time": 6.644098, "total_time": 100.906686 }, "output": [ { "text": "Caption: a woman sitting on the beach with a dog" } ], "started_at": "2022-02-06T17:53:37.256464Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/i5xhgehjkjfyhlx7dg2f5tnrti", "cancel": "https://api.replicate.com/v1/predictions/i5xhgehjkjfyhlx7dg2f5tnrti/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8Input
{ "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/222a1a8a-9ebe-4d38-82cb-9d755020efc7/demo.jpg", "caption": "a dog and a women are sitting at the beach" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "image_text_matching", image: "https://replicate.delivery/mgxm/222a1a8a-9ebe-4d38-82cb-9d755020efc7/demo.jpg", caption: "a dog and a women are sitting at the beach" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/222a1a8a-9ebe-4d38-82cb-9d755020efc7/demo.jpg", "caption": "a dog and a women are sitting at the beach" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/222a1a8a-9ebe-4d38-82cb-9d755020efc7/demo.jpg", "caption": "a dog and a women are sitting at the beach" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
The image and text is matched with a probability of 0.9977. The image feature and text feature has a cosine similarity of 0.5177.{ "completed_at": "2022-02-06T17:55:18.913802Z", "created_at": "2022-02-06T17:55:17.911813Z", "data_removed": false, "error": null, "id": "m2ps5uu7rbbnxpfwmdebf7qnr4", "input": { "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/222a1a8a-9ebe-4d38-82cb-9d755020efc7/demo.jpg", "caption": "a dog and a women are sitting at the beach" }, "logs": null, "metrics": { "predict_time": 0.769844, "total_time": 1.001989 }, "output": [ { "text": "The image and text is matched with a probability of 0.9977.\nThe image feature and text feature has a cosine similarity of 0.5177." } ], "started_at": "2022-02-06T17:55:18.143958Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/m2ps5uu7rbbnxpfwmdebf7qnr4", "cancel": "https://api.replicate.com/v1/predictions/m2ps5uu7rbbnxpfwmdebf7qnr4/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8Input
{ "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/2c0e8a0d-232d-4cfa-b97a-b3258be2a2e5/demo.jpg", "caption": "a dog and a cat are playing in the garden" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "image_text_matching", image: "https://replicate.delivery/mgxm/2c0e8a0d-232d-4cfa-b97a-b3258be2a2e5/demo.jpg", caption: "a dog and a cat are playing in the garden" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/2c0e8a0d-232d-4cfa-b97a-b3258be2a2e5/demo.jpg", "caption": "a dog and a cat are playing in the garden" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/2c0e8a0d-232d-4cfa-b97a-b3258be2a2e5/demo.jpg", "caption": "a dog and a cat are playing in the garden" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
The image and text is matched with a probability of 0.0000. The image feature and text feature has a cosine similarity of 0.2619.{ "completed_at": "2022-02-06T17:55:49.450008Z", "created_at": "2022-02-06T17:55:48.522012Z", "data_removed": false, "error": null, "id": "fmljgux3ajgn5knswprvff4tkq", "input": { "task": "image_text_matching", "image": "https://replicate.delivery/mgxm/2c0e8a0d-232d-4cfa-b97a-b3258be2a2e5/demo.jpg", "caption": "a dog and a cat are playing in the garden" }, "logs": null, "metrics": { "predict_time": 0.734788, "total_time": 0.927996 }, "output": [ { "text": "The image and text is matched with a probability of 0.0000.\nThe image feature and text feature has a cosine similarity of 0.2619." } ], "started_at": "2022-02-06T17:55:48.715220Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/fmljgux3ajgn5knswprvff4tkq", "cancel": "https://api.replicate.com/v1/predictions/fmljgux3ajgn5knswprvff4tkq/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8IDkt5yvsmuhfb7bfc5gnkzor2i3yStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/32e7126a-dd86-4e8c-8706-5855b8b69cf1/demo.jpg", "question": "where is the woman?" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "visual_question_answering", image: "https://replicate.delivery/mgxm/32e7126a-dd86-4e8c-8706-5855b8b69cf1/demo.jpg", question: "where is the woman?" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/32e7126a-dd86-4e8c-8706-5855b8b69cf1/demo.jpg", "question": "where is the woman?" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/32e7126a-dd86-4e8c-8706-5855b8b69cf1/demo.jpg", "question": "where is the woman?" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Answer: on beach{ "completed_at": "2022-02-08T00:46:28.564016Z", "created_at": "2022-02-08T00:43:52.544698Z", "data_removed": false, "error": null, "id": "kt5yvsmuhfb7bfc5gnkzor2i3y", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/32e7126a-dd86-4e8c-8706-5855b8b69cf1/demo.jpg", "question": "where is the woman?" }, "logs": null, "metrics": { "predict_time": 9.082229, "total_time": 156.019318 }, "output": [ { "text": "Answer: on beach" } ], "started_at": "2022-02-08T00:46:19.481787Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/kt5yvsmuhfb7bfc5gnkzor2i3y", "cancel": "https://api.replicate.com/v1/predictions/kt5yvsmuhfb7bfc5gnkzor2i3y/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8IDwwm6t4xre5al3mnman2v5hymfmStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "task": "image_captioning", "image": "https://replicate.delivery/mgxm/13f7ddbb-3906-4b40-ae4e-2fbca7fe01e0/beautiful-scenery-wallpapers-moonlight-beauty.jpg" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "image_captioning", image: "https://replicate.delivery/mgxm/13f7ddbb-3906-4b40-ae4e-2fbca7fe01e0/beautiful-scenery-wallpapers-moonlight-beauty.jpg" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "image_captioning", "image": "https://replicate.delivery/mgxm/13f7ddbb-3906-4b40-ae4e-2fbca7fe01e0/beautiful-scenery-wallpapers-moonlight-beauty.jpg" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "image_captioning", "image": "https://replicate.delivery/mgxm/13f7ddbb-3906-4b40-ae4e-2fbca7fe01e0/beautiful-scenery-wallpapers-moonlight-beauty.jpg" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Caption: a painting of a lake surrounded by trees and flowers{ "completed_at": "2022-02-09T00:38:11.950897Z", "created_at": "2022-02-09T00:33:50.807735Z", "data_removed": false, "error": null, "id": "wwm6t4xre5al3mnman2v5hymfm", "input": { "task": "image_captioning", "image": "https://replicate.delivery/mgxm/13f7ddbb-3906-4b40-ae4e-2fbca7fe01e0/beautiful-scenery-wallpapers-moonlight-beauty.jpg" }, "logs": null, "metrics": { "predict_time": 5.161374, "total_time": 261.143162 }, "output": [ { "text": "Caption: a painting of a lake surrounded by trees and flowers" } ], "started_at": "2022-02-09T00:38:06.789523Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/wwm6t4xre5al3mnman2v5hymfm", "cancel": "https://api.replicate.com/v1/predictions/wwm6t4xre5al3mnman2v5hymfm/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8IDmojxr2cdczexzjxsvjuvbummqiStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/ceba852d-1e52-4004-ae8b-86869790dbc3/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is standing on the rock?" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "visual_question_answering", image: "https://replicate.delivery/mgxm/ceba852d-1e52-4004-ae8b-86869790dbc3/beautiful-scenery-wallpapers-moonlight-beauty.jpg", question: "what is standing on the rock?" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/ceba852d-1e52-4004-ae8b-86869790dbc3/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is standing on the rock?" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/ceba852d-1e52-4004-ae8b-86869790dbc3/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is standing on the rock?" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Answer: deer{ "completed_at": "2022-02-09T00:45:19.451289Z", "created_at": "2022-02-09T00:45:18.298758Z", "data_removed": false, "error": null, "id": "mojxr2cdczexzjxsvjuvbummqi", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/ceba852d-1e52-4004-ae8b-86869790dbc3/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is standing on the rock?" }, "logs": null, "metrics": { "predict_time": 0.916121, "total_time": 1.152531 }, "output": [ { "text": "Answer: deer" } ], "started_at": "2022-02-09T00:45:18.535168Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/mojxr2cdczexzjxsvjuvbummqi", "cancel": "https://api.replicate.com/v1/predictions/mojxr2cdczexzjxsvjuvbummqi/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8IDr4m2l3fcjzdk5pcaw3yxddi7suStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/efe546ab-97e8-417c-9716-33a9ff8f7514/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the lake?" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "visual_question_answering", image: "https://replicate.delivery/mgxm/efe546ab-97e8-417c-9716-33a9ff8f7514/beautiful-scenery-wallpapers-moonlight-beauty.jpg", question: "what is in the lake?" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/efe546ab-97e8-417c-9716-33a9ff8f7514/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the lake?" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/efe546ab-97e8-417c-9716-33a9ff8f7514/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the lake?" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Answer: swans{ "completed_at": "2022-02-09T00:45:38.603992Z", "created_at": "2022-02-09T00:45:37.340433Z", "data_removed": false, "error": null, "id": "r4m2l3fcjzdk5pcaw3yxddi7su", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/efe546ab-97e8-417c-9716-33a9ff8f7514/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the lake?" }, "logs": null, "metrics": { "predict_time": 0.96601, "total_time": 1.263559 }, "output": [ { "text": "Answer: swans" } ], "started_at": "2022-02-09T00:45:37.637982Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/r4m2l3fcjzdk5pcaw3yxddi7su", "cancel": "https://api.replicate.com/v1/predictions/r4m2l3fcjzdk5pcaw3yxddi7su/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated inPrediction
salesforce/blip:2e1dddc8IDhsru35hlhnd53ilh6o3fq4d7s4StatusSucceededSourceWebHardware–Total durationCreatedInput
{ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/7ce95df7-5794-42dc-bd3c-068ef8c12c2f/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the sky?" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", { input: { task: "visual_question_answering", image: "https://replicate.delivery/mgxm/7ce95df7-5794-42dc-bd3c-068ef8c12c2f/beautiful-scenery-wallpapers-moonlight-beauty.jpg", question: "what is in the sky?" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:import replicate
Run salesforce/blip using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "salesforce/blip:2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", input={ "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/7ce95df7-5794-42dc-bd3c-068ef8c12c2f/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the sky?" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run salesforce/blip 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": "2e1dddc8621f72155f24cf2e0adbde548458d3cab9f00c0139eea840d0ac4746", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/7ce95df7-5794-42dc-bd3c-068ef8c12c2f/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the sky?" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
Answer: moon{ "completed_at": "2022-02-09T00:45:49.770308Z", "created_at": "2022-02-09T00:45:48.599456Z", "data_removed": false, "error": null, "id": "hsru35hlhnd53ilh6o3fq4d7s4", "input": { "task": "visual_question_answering", "image": "https://replicate.delivery/mgxm/7ce95df7-5794-42dc-bd3c-068ef8c12c2f/beautiful-scenery-wallpapers-moonlight-beauty.jpg", "question": "what is in the sky?" }, "logs": null, "metrics": { "predict_time": 0.997771, "total_time": 1.170852 }, "output": [ { "text": "Answer: moon" } ], "started_at": "2022-02-09T00:45:48.772537Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/hsru35hlhnd53ilh6o3fq4d7s4", "cancel": "https://api.replicate.com/v1/predictions/hsru35hlhnd53ilh6o3fq4d7s4/cancel" }, "version": "5a977fcb091363cc3938cc870c9f6242f5938267040e6837373387bb90d23099" }
Generated in
Want to make some of these yourself?
Run this model