typefile
{
"input_video": "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4",
"output_type": "green-screen"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UKh**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run arielreplicate/robust_video_matting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503",
{
input: {
input_video: "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4",
output_type: "green-screen"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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_UKh**********************************
This is your API token. Keep it to yourself.
import replicate
Run arielreplicate/robust_video_matting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503",
input={
"input_video": "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4",
"output_type": "green-screen"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UKh**********************************
This is your API token. Keep it to yourself.
Run arielreplicate/robust_video_matting 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": "arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503",
"input": {
"input_video": "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4",
"output_type": "green-screen"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "iqaowdlwcnbxresiand63tzn5a",
"model": "arielreplicate/robust_video_matting",
"version": "2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503",
"input": {
"input_video": "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4",
"output_type": "green-screen"
},
"logs": "0%| | 0/382 [00:00<?, ?it/s]/root/.pyenv/versions/3.8.15/lib/python3.8/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at /pytorch/c10/core/TensorImpl.h:1156.)\nreturn torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)\n 3%|▎ | 12/382 [00:02<01:25, 4.30it/s]\n 6%|▋ | 24/382 [00:04<01:10, 5.05it/s]\n 9%|▉ | 36/382 [00:07<01:05, 5.29it/s]\n 13%|█▎ | 48/382 [00:10<01:19, 4.19it/s]\n 16%|█▌ | 60/382 [00:14<01:22, 3.92it/s]\n 19%|█▉ | 72/382 [00:17<01:22, 3.74it/s]\n 22%|██▏ | 84/382 [00:20<01:16, 3.88it/s]\n 25%|██▌ | 96/382 [00:23<01:12, 3.96it/s]\n 28%|██▊ | 108/382 [00:26<01:06, 4.10it/s]\n 31%|███▏ | 120/382 [00:28<01:03, 4.13it/s]\n 35%|███▍ | 132/382 [00:31<00:59, 4.23it/s]\n 38%|███▊ | 144/382 [00:34<00:57, 4.12it/s]\n 41%|████ | 156/382 [00:37<00:55, 4.07it/s]\n 44%|████▍ | 168/382 [00:40<00:53, 4.04it/s]\n 47%|████▋ | 180/382 [00:43<00:49, 4.07it/s]\n 50%|█████ | 192/382 [00:46<00:46, 4.11it/s]\n 53%|█████▎ | 204/382 [00:49<00:42, 4.16it/s]\n 57%|█████▋ | 216/382 [00:52<00:40, 4.05it/s]\n 60%|█████▉ | 228/382 [00:55<00:38, 4.05it/s]\n 63%|██████▎ | 240/382 [00:58<00:35, 4.02it/s]\n 66%|██████▌ | 252/382 [01:01<00:31, 4.11it/s]\n 69%|██████▉ | 264/382 [01:04<00:28, 4.17it/s]\n 72%|███████▏ | 276/382 [01:06<00:24, 4.28it/s]\n 75%|███████▌ | 288/382 [01:09<00:22, 4.22it/s]\n 79%|███████▊ | 300/382 [01:12<00:19, 4.23it/s]\n 82%|████████▏ | 312/382 [01:15<00:16, 4.26it/s]\n 85%|████████▍ | 324/382 [01:17<00:13, 4.28it/s]\n 88%|████████▊ | 336/382 [01:20<00:10, 4.24it/s]\n 91%|█████████ | 348/382 [01:23<00:07, 4.25it/s]\n 94%|█████████▍| 360/382 [01:26<00:05, 4.20it/s]\n 97%|█████████▋| 372/382 [01:29<00:02, 4.20it/s]\n100%|██████████| 382/382 [01:31<00:00, 4.20it/s]",
"output": "https://replicate.delivery/pbxt/V3iFlL5JotpbLtkUqGcnrpsiRfXume3Jm0020Iu0hX0hBoDQA/green-screen.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2022-11-25T14:11:53.705436Z",
"started_at": "2022-11-25T14:15:29.407127Z",
"completed_at": "2022-11-25T14:17:06.618254Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/iqaowdlwcnbxresiand63tzn5a/cancel",
"get": "https://api.replicate.com/v1/predictions/iqaowdlwcnbxresiand63tzn5a"
},
"metrics": {
"predict_time": 97.211127,
"total_time": 312.912818
}
}