cjwbw
/
semantic-segment-anything
Adding semantic labels for segment anything
Prediction
cjwbw/semantic-segment-anything:b2691db5Input
{ "image": "https://replicate.delivery/pbxt/IeDgvgehYgR4YpUT8SqRjP7qLisjjKbJ0MsAUaHII5FhHpVN/a.jpg", "output_json": true }
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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", { input: { image: "https://replicate.delivery/pbxt/IeDgvgehYgR4YpUT8SqRjP7qLisjjKbJ0MsAUaHII5FhHpVN/a.jpg", output_json: true } } ); 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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", input={ "image": "https://replicate.delivery/pbxt/IeDgvgehYgR4YpUT8SqRjP7qLisjjKbJ0MsAUaHII5FhHpVN/a.jpg", "output_json": True } ) 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 cjwbw/semantic-segment-anything 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": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", "input": { "image": "https://replicate.delivery/pbxt/IeDgvgehYgR4YpUT8SqRjP7qLisjjKbJ0MsAUaHII5FhHpVN/a.jpg", "output_json": true } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
json_out
seg_out.json{ "completed_at": "2023-04-14T01:35:06.377180Z", "created_at": "2023-04-14T01:33:03.295440Z", "data_removed": false, "error": null, "id": "smqylmbmsraihdta56g2uejoze", "input": { "image": "https://replicate.delivery/pbxt/IeDgvgehYgR4YpUT8SqRjP7qLisjjKbJ0MsAUaHII5FhHpVN/a.jpg", "output_json": true }, "logs": "/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)\nreturn _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]\n/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/transformers/generation/utils.py:1288: UserWarning: Using `max_length`'s default (20) to control the generation length. This behaviour is deprecated and will be removed from the config in v5 of Transformers -- we recommend using `max_new_tokens` to control the maximum length of the generation.\nwarnings.warn(", "metrics": { "predict_time": 46.838457, "total_time": 123.08174 }, "output": { "img_out": "https://replicate.delivery/pbxt/zttLZCfyXp1aDqS5Gd1OeDuiaPGnN722jFio5hNeXyUSeXGDB/seg_out.png", "json_out": "https://replicate.delivery/pbxt/ZNh6er6mvwWfNUSZWdfStS9lTfQl1PnCGkk6QI9zvJWm8XGDB/seg_out.json" }, "started_at": "2023-04-14T01:34:19.538723Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/smqylmbmsraihdta56g2uejoze", "cancel": "https://api.replicate.com/v1/predictions/smqylmbmsraihdta56g2uejoze/cancel" }, "version": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256" }
Generated in/root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] /root/.pyenv/versions/3.8.16/lib/python3.8/site-packages/transformers/generation/utils.py:1288: UserWarning: Using `max_length`'s default (20) to control the generation length. This behaviour is deprecated and will be removed from the config in v5 of Transformers -- we recommend using `max_new_tokens` to control the maximum length of the generation. warnings.warn(
Prediction
cjwbw/semantic-segment-anything:b2691db5IDyfrjq2ludvc7fhomtiemypi2r4StatusSucceededSourceWebHardware–Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/IeDq86GZlFsUzaOJsVtZsMBhTKRagCDF2tJvnUaTyUfKTRu5/sa_10013862.jpg", "output_json": true }
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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", { input: { image: "https://replicate.delivery/pbxt/IeDq86GZlFsUzaOJsVtZsMBhTKRagCDF2tJvnUaTyUfKTRu5/sa_10013862.jpg", output_json: true } } ); 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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", input={ "image": "https://replicate.delivery/pbxt/IeDq86GZlFsUzaOJsVtZsMBhTKRagCDF2tJvnUaTyUfKTRu5/sa_10013862.jpg", "output_json": True } ) 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 cjwbw/semantic-segment-anything 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": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", "input": { "image": "https://replicate.delivery/pbxt/IeDq86GZlFsUzaOJsVtZsMBhTKRagCDF2tJvnUaTyUfKTRu5/sa_10013862.jpg", "output_json": true } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
json_out
seg_out.json{ "completed_at": "2023-04-14T01:43:55.356431Z", "created_at": "2023-04-14T01:42:45.603696Z", "data_removed": false, "error": null, "id": "yfrjq2ludvc7fhomtiemypi2r4", "input": { "image": "https://replicate.delivery/pbxt/IeDq86GZlFsUzaOJsVtZsMBhTKRagCDF2tJvnUaTyUfKTRu5/sa_10013862.jpg", "output_json": true }, "logs": null, "metrics": { "predict_time": 69.53675, "total_time": 69.752735 }, "output": { "img_out": "https://replicate.delivery/pbxt/wnSCz6fSpenNYUkhCJE3roVmk7oxkJGL5CxLl8HujrVaHmxQA/seg_out.png", "json_out": "https://replicate.delivery/pbxt/anToYxmKRb4dGZlo2jpgJoHgjjcumoCkntLqwAg69Ou2hZME/seg_out.json" }, "started_at": "2023-04-14T01:42:45.819681Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/yfrjq2ludvc7fhomtiemypi2r4", "cancel": "https://api.replicate.com/v1/predictions/yfrjq2ludvc7fhomtiemypi2r4/cancel" }, "version": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256" }
Generated inPrediction
cjwbw/semantic-segment-anything:b2691db5IDnugo6fqkjbfvhioofwk2ysghaaStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/IeDnGiu4B0bmC0inKg8fdyuYXyp6PQJj6rUETYfeSZwOHZeG/sa_10014318.jpg", "output_json": false }
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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", { input: { image: "https://replicate.delivery/pbxt/IeDnGiu4B0bmC0inKg8fdyuYXyp6PQJj6rUETYfeSZwOHZeG/sa_10014318.jpg", output_json: false } } ); 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 cjwbw/semantic-segment-anything using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/semantic-segment-anything:b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", input={ "image": "https://replicate.delivery/pbxt/IeDnGiu4B0bmC0inKg8fdyuYXyp6PQJj6rUETYfeSZwOHZeG/sa_10014318.jpg", "output_json": False } ) 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 cjwbw/semantic-segment-anything 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": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256", "input": { "image": "https://replicate.delivery/pbxt/IeDnGiu4B0bmC0inKg8fdyuYXyp6PQJj6rUETYfeSZwOHZeG/sa_10014318.jpg", "output_json": false } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2023-04-14T01:41:06.778399Z", "created_at": "2023-04-14T01:39:45.243117Z", "data_removed": false, "error": null, "id": "nugo6fqkjbfvhioofwk2ysghaa", "input": { "image": "https://replicate.delivery/pbxt/IeDnGiu4B0bmC0inKg8fdyuYXyp6PQJj6rUETYfeSZwOHZeG/sa_10014318.jpg", "output_json": false }, "logs": null, "metrics": { "predict_time": 81.375152, "total_time": 81.535282 }, "output": { "img_out": "https://replicate.delivery/pbxt/y4Jeg4LSkdRTP6EKPmlyg3xc0CmGhvVzvLBtCbz5rfqyEmxQA/seg_out.png", "json_out": null }, "started_at": "2023-04-14T01:39:45.403247Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/nugo6fqkjbfvhioofwk2ysghaa", "cancel": "https://api.replicate.com/v1/predictions/nugo6fqkjbfvhioofwk2ysghaa/cancel" }, "version": "b2691db53f2d96add0051a4a98e7a3861bd21bf5972031119d344d956d2f8256" }
Generated in
Want to make some of these yourself?
Run this model