arielreplicate/robust_video_matting

extract foreground of a video

Highly Accurate Dichotomous Image Segmentation (ECCV 2022)

Use Runway's Stable-diffusion inpainting model to create an infinite loop video

Create a fly by scenery video from a single image

Multi stage image editing of images using stable-diffusion with a mask and a prompt

Fast text2image model

Image super-resolution with stable-diffusion V2

Fast image interpolation model

Fast image variation model

Fast image outpainting model

Latent diffusion models, replacing the commonly-used U-Net backbone with a transformer that operates on latent patches

Add colours to old images

Assess the quality of an image

Add colours to old video footage.

Shows what CLIP looks at in an image given text

Edit images with human instructions

High accuracy depth maps from pairs of stereo images
Prediction
arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503IDiqaowdlwcnbxresiand63tzn5aStatusSucceededSourceWebHardware–Total durationCreatedInput
- input_video
- output_type
- green-screen
{ "input_video": "https://replicate.delivery/pbxt/HqiGGuuwynO7sCHpcQdYQsIf04NotwOrDdbhBf4M6Pou6MGg/butter.mp4", "output_type": "green-screen" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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.
Install Replicate’s Python client library:pip install replicate
Import the client: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.
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.
Output
{ "completed_at": "2022-11-25T14:17:06.618254Z", "created_at": "2022-11-25T14:11:53.705436Z", "data_removed": false, "error": null, "id": "iqaowdlwcnbxresiand63tzn5a", "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]", "metrics": { "predict_time": 97.211127, "total_time": 312.912818 }, "output": "https://replicate.delivery/pbxt/V3iFlL5JotpbLtkUqGcnrpsiRfXume3Jm0020Iu0hX0hBoDQA/green-screen.mp4", "started_at": "2022-11-25T14:15:29.407127Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/iqaowdlwcnbxresiand63tzn5a", "cancel": "https://api.replicate.com/v1/predictions/iqaowdlwcnbxresiand63tzn5a/cancel" }, "version": "2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503" }
Generated in0%| | 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.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) 3%|▎ | 12/382 [00:02<01:25, 4.30it/s] 6%|▋ | 24/382 [00:04<01:10, 5.05it/s] 9%|▉ | 36/382 [00:07<01:05, 5.29it/s] 13%|█▎ | 48/382 [00:10<01:19, 4.19it/s] 16%|█▌ | 60/382 [00:14<01:22, 3.92it/s] 19%|█▉ | 72/382 [00:17<01:22, 3.74it/s] 22%|██▏ | 84/382 [00:20<01:16, 3.88it/s] 25%|██▌ | 96/382 [00:23<01:12, 3.96it/s] 28%|██▊ | 108/382 [00:26<01:06, 4.10it/s] 31%|███▏ | 120/382 [00:28<01:03, 4.13it/s] 35%|███▍ | 132/382 [00:31<00:59, 4.23it/s] 38%|███▊ | 144/382 [00:34<00:57, 4.12it/s] 41%|████ | 156/382 [00:37<00:55, 4.07it/s] 44%|████▍ | 168/382 [00:40<00:53, 4.04it/s] 47%|████▋ | 180/382 [00:43<00:49, 4.07it/s] 50%|█████ | 192/382 [00:46<00:46, 4.11it/s] 53%|█████▎ | 204/382 [00:49<00:42, 4.16it/s] 57%|█████▋ | 216/382 [00:52<00:40, 4.05it/s] 60%|█████▉ | 228/382 [00:55<00:38, 4.05it/s] 63%|██████▎ | 240/382 [00:58<00:35, 4.02it/s] 66%|██████▌ | 252/382 [01:01<00:31, 4.11it/s] 69%|██████▉ | 264/382 [01:04<00:28, 4.17it/s] 72%|███████▏ | 276/382 [01:06<00:24, 4.28it/s] 75%|███████▌ | 288/382 [01:09<00:22, 4.22it/s] 79%|███████▊ | 300/382 [01:12<00:19, 4.23it/s] 82%|████████▏ | 312/382 [01:15<00:16, 4.26it/s] 85%|████████▍ | 324/382 [01:17<00:13, 4.28it/s] 88%|████████▊ | 336/382 [01:20<00:10, 4.24it/s] 91%|█████████ | 348/382 [01:23<00:07, 4.25it/s] 94%|█████████▍| 360/382 [01:26<00:05, 4.20it/s] 97%|█████████▋| 372/382 [01:29<00:02, 4.20it/s] 100%|██████████| 382/382 [01:31<00:00, 4.20it/s]
Prediction
arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503IDc4zkevc27fhntpw3ekgb2ok2sqStatusSucceededSourceWebHardware–Total durationCreatedInput
- input_video
- output_type
- green-screen
{ "input_video": "https://replicate.delivery/pbxt/HqiUPeOL0NMmX1yzan5USbiFloRmxVcrKqBuslIlNdofpYAr/dance2.mp4", "output_type": "green-screen" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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/HqiUPeOL0NMmX1yzan5USbiFloRmxVcrKqBuslIlNdofpYAr/dance2.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.
Install Replicate’s Python client library:pip install replicate
Import the client: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/HqiUPeOL0NMmX1yzan5USbiFloRmxVcrKqBuslIlNdofpYAr/dance2.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.
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/HqiUPeOL0NMmX1yzan5USbiFloRmxVcrKqBuslIlNdofpYAr/dance2.mp4", "output_type": "green-screen" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-11-25T14:29:11.572602Z", "created_at": "2022-11-25T14:26:35.172178Z", "data_removed": false, "error": null, "id": "c4zkevc27fhntpw3ekgb2ok2sq", "input": { "input_video": "https://replicate.delivery/pbxt/HqiUPeOL0NMmX1yzan5USbiFloRmxVcrKqBuslIlNdofpYAr/dance2.mp4", "output_type": "green-screen" }, "logs": "0%| | 0/606 [00:00<?, ?it/s]\u001b[A\u001b[A\u001b[A\n 2%|▏ | 12/606 [00:02<01:56, 5.08it/s]\u001b[A\u001b[A\u001b[A\n 4%|▍ | 24/606 [00:04<01:48, 5.37it/s]\u001b[A\u001b[A\u001b[A\n 6%|▌ | 36/606 [00:06<01:46, 5.37it/s]\u001b[A\u001b[A\u001b[A\n 8%|▊ | 48/606 [00:10<02:06, 4.40it/s]\u001b[A\u001b[A\u001b[A\n 10%|▉ | 60/606 [00:13<02:11, 4.14it/s]\u001b[A\u001b[A\u001b[A\n 12%|█▏ | 72/606 [00:16<02:10, 4.09it/s]\u001b[A\u001b[A\u001b[A\n 14%|█▍ | 84/606 [00:19<02:07, 4.08it/s]\u001b[A\u001b[A\u001b[A\n 16%|█▌ | 96/606 [00:22<02:04, 4.09it/s]\u001b[A\u001b[A\u001b[A\n 18%|█▊ | 108/606 [00:25<02:02, 4.05it/s]\u001b[A\u001b[A\u001b[A\n 20%|█▉ | 120/606 [00:28<01:59, 4.07it/s]\u001b[A\u001b[A\u001b[A\n 22%|██▏ | 132/606 [00:31<01:56, 4.05it/s]\u001b[A\u001b[A\u001b[A\n 24%|██▍ | 144/606 [00:34<01:55, 4.00it/s]\u001b[A\u001b[A\u001b[A\n 26%|██▌ | 156/606 [00:37<01:52, 4.00it/s]\u001b[A\u001b[A\u001b[A\n 28%|██▊ | 168/606 [00:40<01:48, 4.02it/s]\u001b[A\u001b[A\u001b[A\n 30%|██▉ | 180/606 [00:43<01:45, 4.03it/s]\u001b[A\u001b[A\u001b[A\n 32%|███▏ | 192/606 [00:46<01:42, 4.04it/s]\u001b[A\u001b[A\u001b[A\n 34%|███▎ | 204/606 [00:49<01:41, 3.97it/s]\u001b[A\u001b[A\u001b[A\n 36%|███▌ | 216/606 [00:52<01:39, 3.93it/s]\u001b[A\u001b[A\u001b[A\n 38%|███▊ | 228/606 [00:55<01:37, 3.86it/s]\u001b[A\u001b[A\u001b[A\n 40%|███▉ | 240/606 [00:58<01:35, 3.83it/s]\u001b[A\u001b[A\u001b[A\n 42%|████▏ | 252/606 [01:01<01:31, 3.87it/s]\u001b[A\u001b[A\u001b[A\n 44%|████▎ | 264/606 [01:04<01:26, 3.93it/s]\u001b[A\u001b[A\u001b[A\n 46%|████▌ | 276/606 [01:07<01:22, 3.98it/s]\u001b[A\u001b[A\u001b[A\n 48%|████▊ | 288/606 [01:10<01:21, 3.92it/s]\u001b[A\u001b[A\u001b[A\n 50%|████▉ | 300/606 [01:14<01:19, 3.87it/s]\u001b[A\u001b[A\u001b[A\n 51%|█████▏ | 312/606 [01:17<01:16, 3.84it/s]\u001b[A\u001b[A\u001b[A\n 53%|█████▎ | 324/606 [01:20<01:12, 3.88it/s]\u001b[A\u001b[A\u001b[A\n 55%|█████▌ | 336/606 [01:23<01:08, 3.95it/s]\u001b[A\u001b[A\u001b[A\n 57%|█████▋ | 348/606 [01:26<01:04, 3.98it/s]\u001b[A\u001b[A\u001b[A\n 59%|█████▉ | 360/606 [01:29<01:01, 3.97it/s]\u001b[A\u001b[A\u001b[A\n 61%|██████▏ | 372/606 [01:32<00:59, 3.95it/s]\u001b[A\u001b[A\u001b[A\n 63%|██████▎ | 384/606 [01:35<00:56, 3.95it/s]\u001b[A\u001b[A\u001b[A\n 65%|██████▌ | 396/606 [01:38<00:52, 3.99it/s]\u001b[A\u001b[A\u001b[A\n 67%|██████▋ | 408/606 [01:41<00:49, 3.98it/s]\u001b[A\u001b[A\u001b[A\n 69%|██████▉ | 420/606 [01:44<00:47, 3.94it/s]\u001b[A\u001b[A\u001b[A\n 71%|███████▏ | 432/606 [01:47<00:43, 3.98it/s]\u001b[A\u001b[A\u001b[A\n 73%|███████▎ | 444/606 [01:50<00:40, 3.97it/s]\u001b[A\u001b[A\u001b[A\n 75%|███████▌ | 456/606 [01:53<00:38, 3.92it/s]\u001b[A\u001b[A\u001b[A\n 77%|███████▋ | 468/606 [01:56<00:34, 3.95it/s]\u001b[A\u001b[A\u001b[A\n 79%|███████▉ | 480/606 [01:59<00:31, 3.96it/s]\u001b[A\u001b[A\u001b[A\n 81%|████████ | 492/606 [02:02<00:28, 3.95it/s]\u001b[A\u001b[A\u001b[A\n 83%|████████▎ | 504/606 [02:06<00:26, 3.81it/s]\u001b[A\u001b[A\u001b[A\n 85%|████████▌ | 516/606 [02:09<00:23, 3.77it/s]\u001b[A\u001b[A\u001b[A\n 87%|████████▋ | 528/606 [02:12<00:20, 3.83it/s]\u001b[A\u001b[A\u001b[A\n 89%|████████▉ | 540/606 [02:15<00:16, 3.91it/s]\u001b[A\u001b[A\u001b[A\n 91%|█████████ | 552/606 [02:18<00:13, 3.97it/s]\u001b[A\u001b[A\u001b[A\n 93%|█████████▎| 564/606 [02:21<00:10, 3.93it/s]\u001b[A\u001b[A\u001b[A\n 95%|█████████▌| 576/606 [02:24<00:07, 3.88it/s]\u001b[A\u001b[A\u001b[A\n 97%|█████████▋| 588/606 [02:27<00:04, 3.91it/s]\u001b[A\u001b[A\u001b[A\n 99%|█████████▉| 600/606 [02:30<00:01, 3.93it/s]\u001b[A\u001b[A\u001b[A\n100%|██████████| 606/606 [02:32<00:00, 3.89it/s]\u001b[A\u001b[A\u001b[A", "metrics": { "predict_time": 156.3639, "total_time": 156.400424 }, "output": "https://replicate.delivery/pbxt/HuwFjWn7A9bcH5CfhQ7KO79N3z4uZf9sTtLoo4PDnXY2MoDQA/green-screen.mp4", "started_at": "2022-11-25T14:26:35.208702Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/c4zkevc27fhntpw3ekgb2ok2sq", "cancel": "https://api.replicate.com/v1/predictions/c4zkevc27fhntpw3ekgb2ok2sq/cancel" }, "version": "2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503" }
Generated in0%| | 0/606 [00:00<?, ?it/s] 2%|▏ | 12/606 [00:02<01:56, 5.08it/s] 4%|▍ | 24/606 [00:04<01:48, 5.37it/s] 6%|▌ | 36/606 [00:06<01:46, 5.37it/s] 8%|▊ | 48/606 [00:10<02:06, 4.40it/s] 10%|▉ | 60/606 [00:13<02:11, 4.14it/s] 12%|█▏ | 72/606 [00:16<02:10, 4.09it/s] 14%|█▍ | 84/606 [00:19<02:07, 4.08it/s] 16%|█▌ | 96/606 [00:22<02:04, 4.09it/s] 18%|█▊ | 108/606 [00:25<02:02, 4.05it/s] 20%|█▉ | 120/606 [00:28<01:59, 4.07it/s] 22%|██▏ | 132/606 [00:31<01:56, 4.05it/s] 24%|██▍ | 144/606 [00:34<01:55, 4.00it/s] 26%|██▌ | 156/606 [00:37<01:52, 4.00it/s] 28%|██▊ | 168/606 [00:40<01:48, 4.02it/s] 30%|██▉ | 180/606 [00:43<01:45, 4.03it/s] 32%|███▏ | 192/606 [00:46<01:42, 4.04it/s] 34%|███▎ | 204/606 [00:49<01:41, 3.97it/s] 36%|███▌ | 216/606 [00:52<01:39, 3.93it/s] 38%|███▊ | 228/606 [00:55<01:37, 3.86it/s] 40%|███▉ | 240/606 [00:58<01:35, 3.83it/s] 42%|████▏ | 252/606 [01:01<01:31, 3.87it/s] 44%|████▎ | 264/606 [01:04<01:26, 3.93it/s] 46%|████▌ | 276/606 [01:07<01:22, 3.98it/s] 48%|████▊ | 288/606 [01:10<01:21, 3.92it/s] 50%|████▉ | 300/606 [01:14<01:19, 3.87it/s] 51%|█████▏ | 312/606 [01:17<01:16, 3.84it/s] 53%|█████▎ | 324/606 [01:20<01:12, 3.88it/s] 55%|█████▌ | 336/606 [01:23<01:08, 3.95it/s] 57%|█████▋ | 348/606 [01:26<01:04, 3.98it/s] 59%|█████▉ | 360/606 [01:29<01:01, 3.97it/s] 61%|██████▏ | 372/606 [01:32<00:59, 3.95it/s] 63%|██████▎ | 384/606 [01:35<00:56, 3.95it/s] 65%|██████▌ | 396/606 [01:38<00:52, 3.99it/s] 67%|██████▋ | 408/606 [01:41<00:49, 3.98it/s] 69%|██████▉ | 420/606 [01:44<00:47, 3.94it/s] 71%|███████▏ | 432/606 [01:47<00:43, 3.98it/s] 73%|███████▎ | 444/606 [01:50<00:40, 3.97it/s] 75%|███████▌ | 456/606 [01:53<00:38, 3.92it/s] 77%|███████▋ | 468/606 [01:56<00:34, 3.95it/s] 79%|███████▉ | 480/606 [01:59<00:31, 3.96it/s] 81%|████████ | 492/606 [02:02<00:28, 3.95it/s] 83%|████████▎ | 504/606 [02:06<00:26, 3.81it/s] 85%|████████▌ | 516/606 [02:09<00:23, 3.77it/s] 87%|████████▋ | 528/606 [02:12<00:20, 3.83it/s] 89%|████████▉ | 540/606 [02:15<00:16, 3.91it/s] 91%|█████████ | 552/606 [02:18<00:13, 3.97it/s] 93%|█████████▎| 564/606 [02:21<00:10, 3.93it/s] 95%|█████████▌| 576/606 [02:24<00:07, 3.88it/s] 97%|█████████▋| 588/606 [02:27<00:04, 3.91it/s] 99%|█████████▉| 600/606 [02:30<00:01, 3.93it/s] 100%|██████████| 606/606 [02:32<00:00, 3.89it/s]
Prediction
arielreplicate/robust_video_matting:2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503IDin5yh3obxrdmvgr6mxgalzzeliStatusSucceededSourceWebHardware–Total durationCreatedInput
- input_video
- output_type
- green-screen
{ "input_video": "https://replicate.delivery/pbxt/HqiZLXVlQCsU4hjSm3LcccJElHRir2ubhSkaGuQAS33P4FP3/bilibili.mp4", "output_type": "green-screen" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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/HqiZLXVlQCsU4hjSm3LcccJElHRir2ubhSkaGuQAS33P4FP3/bilibili.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.
Install Replicate’s Python client library:pip install replicate
Import the client: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/HqiZLXVlQCsU4hjSm3LcccJElHRir2ubhSkaGuQAS33P4FP3/bilibili.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.
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/HqiZLXVlQCsU4hjSm3LcccJElHRir2ubhSkaGuQAS33P4FP3/bilibili.mp4", "output_type": "green-screen" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-11-25T14:38:16.808827Z", "created_at": "2022-11-25T14:32:15.592259Z", "data_removed": false, "error": null, "id": "in5yh3obxrdmvgr6mxgalzzeli", "input": { "input_video": "https://replicate.delivery/pbxt/HqiZLXVlQCsU4hjSm3LcccJElHRir2ubhSkaGuQAS33P4FP3/bilibili.mp4", "output_type": "green-screen" }, "logs": "0%| | 0/1371 [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 1%| | 12/1371 [00:03<06:04, 3.73it/s]\n 2%|▏ | 24/1371 [00:05<05:13, 4.30it/s]\n 3%|▎ | 36/1371 [00:08<05:11, 4.28it/s]\n 4%|▎ | 48/1371 [00:12<05:39, 3.89it/s]\n 4%|▍ | 60/1371 [00:15<05:41, 3.84it/s]\n 5%|▌ | 72/1371 [00:18<05:36, 3.86it/s]\n 6%|▌ | 84/1371 [00:21<05:28, 3.91it/s]\n 7%|▋ | 96/1371 [00:24<05:22, 3.95it/s]\n 8%|▊ | 108/1371 [00:27<05:17, 3.98it/s]\n 9%|▉ | 120/1371 [00:30<05:10, 4.03it/s]\n 10%|▉ | 132/1371 [00:33<05:07, 4.03it/s]\n 11%|█ | 144/1371 [00:36<05:05, 4.02it/s]\n 11%|█▏ | 156/1371 [00:39<05:03, 4.01it/s]\n 12%|█▏ | 168/1371 [00:42<05:01, 4.00it/s]\n 13%|█▎ | 180/1371 [00:45<04:57, 4.00it/s]\n 14%|█▍ | 192/1371 [00:48<04:55, 3.98it/s]\n 15%|█▍ | 204/1371 [00:51<05:06, 3.81it/s]\n 16%|█▌ | 216/1371 [00:54<05:03, 3.80it/s]\n 17%|█▋ | 228/1371 [00:57<04:58, 3.82it/s]\n 18%|█▊ | 240/1371 [01:00<04:53, 3.85it/s]\n 18%|█▊ | 252/1371 [01:04<04:51, 3.84it/s]\n 19%|█▉ | 264/1371 [01:07<04:47, 3.85it/s]\n 20%|██ | 276/1371 [01:10<04:44, 3.84it/s]\n 21%|██ | 288/1371 [01:13<04:43, 3.82it/s]\n 22%|██▏ | 300/1371 [01:16<04:42, 3.79it/s]\n 23%|██▎ | 312/1371 [01:19<04:36, 3.83it/s]\n 24%|██▎ | 324/1371 [01:23<04:39, 3.75it/s]\n 25%|██▍ | 336/1371 [01:26<04:36, 3.74it/s]\n 25%|██▌ | 348/1371 [01:29<04:33, 3.74it/s]\n 26%|██▋ | 360/1371 [01:32<04:28, 3.77it/s]\n 27%|██▋ | 372/1371 [01:35<04:23, 3.79it/s]\n 28%|██▊ | 384/1371 [01:39<04:20, 3.79it/s]\n 29%|██▉ | 396/1371 [01:42<04:16, 3.80it/s]\n 30%|██▉ | 408/1371 [01:45<04:12, 3.82it/s]\n 31%|███ | 420/1371 [01:48<04:09, 3.81it/s]\n 32%|███▏ | 432/1371 [01:51<04:04, 3.84it/s]\n 32%|███▏ | 444/1371 [01:54<04:01, 3.83it/s]\n 33%|███▎ | 456/1371 [01:57<03:57, 3.85it/s]\n 34%|███▍ | 468/1371 [02:00<03:55, 3.83it/s]\n 35%|███▌ | 480/1371 [02:04<03:59, 3.72it/s]\n 36%|███▌ | 492/1371 [02:07<03:56, 3.72it/s]\n 37%|███▋ | 504/1371 [02:10<03:53, 3.72it/s]\n 38%|███▊ | 516/1371 [02:14<03:51, 3.69it/s]\n 39%|███▊ | 528/1371 [02:17<03:47, 3.71it/s]\n 39%|███▉ | 540/1371 [02:20<03:40, 3.76it/s]\n 40%|████ | 552/1371 [02:23<03:37, 3.77it/s]\n 41%|████ | 564/1371 [02:26<03:35, 3.75it/s]\n 42%|████▏ | 576/1371 [02:30<03:31, 3.75it/s]\n 43%|████▎ | 588/1371 [02:33<03:30, 3.73it/s]\n 44%|████▍ | 600/1371 [02:36<03:26, 3.73it/s]\n 45%|████▍ | 612/1371 [02:39<03:21, 3.77it/s]\n 46%|████▌ | 624/1371 [02:42<03:16, 3.80it/s]\n 46%|████▋ | 636/1371 [02:45<03:11, 3.84it/s]\n 47%|████▋ | 648/1371 [02:48<03:07, 3.85it/s]\n 48%|████▊ | 660/1371 [02:51<03:02, 3.89it/s]\n 49%|████▉ | 672/1371 [02:54<02:59, 3.90it/s]\n 50%|████▉ | 684/1371 [02:57<02:56, 3.89it/s]\n 51%|█████ | 696/1371 [03:00<02:50, 3.95it/s]\n 52%|█████▏ | 708/1371 [03:03<02:47, 3.95it/s]\n 53%|█████▎ | 720/1371 [03:06<02:43, 3.97it/s]\n 53%|█████▎ | 732/1371 [03:09<02:41, 3.97it/s]\n 54%|█████▍ | 744/1371 [03:13<02:38, 3.94it/s]\n 55%|█████▌ | 756/1371 [03:16<02:35, 3.96it/s]\n 56%|█████▌ | 768/1371 [03:19<02:32, 3.96it/s]\n 57%|█████▋ | 780/1371 [03:22<02:34, 3.82it/s]\n 58%|█████▊ | 792/1371 [03:25<02:32, 3.80it/s]\n 59%|█████▊ | 804/1371 [03:28<02:29, 3.79it/s]\n 60%|█████▉ | 816/1371 [03:32<02:26, 3.78it/s]\n 60%|██████ | 828/1371 [03:35<02:23, 3.79it/s]\n 61%|██████▏ | 840/1371 [03:38<02:20, 3.79it/s]\n 62%|██████▏ | 852/1371 [03:41<02:15, 3.83it/s]\n 63%|██████▎ | 864/1371 [03:44<02:11, 3.87it/s]\n 64%|██████▍ | 876/1371 [03:47<02:09, 3.83it/s]\n 65%|██████▍ | 888/1371 [03:50<02:06, 3.82it/s]\n 66%|██████▌ | 900/1371 [03:53<02:02, 3.86it/s]\n 67%|██████▋ | 912/1371 [03:56<01:57, 3.90it/s]\n 67%|██████▋ | 924/1371 [03:59<01:54, 3.92it/s]\n 68%|██████▊ | 936/1371 [04:02<01:50, 3.94it/s]\n 69%|██████▉ | 948/1371 [04:05<01:46, 3.97it/s]\n 70%|███████ | 960/1371 [04:08<01:43, 3.98it/s]\n 71%|███████ | 972/1371 [04:11<01:39, 4.00it/s]\n 72%|███████▏ | 984/1371 [04:14<01:37, 3.97it/s]\n 73%|███████▎ | 996/1371 [04:17<01:34, 3.98it/s]\n 74%|███████▎ | 1008/1371 [04:21<01:33, 3.87it/s]\n 74%|███████▍ | 1020/1371 [04:24<01:32, 3.80it/s]\n 75%|███████▌ | 1032/1371 [04:27<01:28, 3.81it/s]\n 76%|███████▌ | 1044/1371 [04:30<01:25, 3.84it/s]\n 77%|███████▋ | 1056/1371 [04:33<01:22, 3.82it/s]\n 78%|███████▊ | 1068/1371 [04:37<01:19, 3.81it/s]\n 79%|███████▉ | 1080/1371 [04:40<01:16, 3.79it/s]\n 80%|███████▉ | 1092/1371 [04:43<01:13, 3.78it/s]\n 81%|████████ | 1104/1371 [04:46<01:10, 3.77it/s]\n 81%|████████▏ | 1116/1371 [04:50<01:08, 3.70it/s]\n 82%|████████▏ | 1128/1371 [04:53<01:06, 3.68it/s]\n 83%|████████▎ | 1140/1371 [04:56<01:02, 3.68it/s]\n 84%|████████▍ | 1152/1371 [04:59<00:59, 3.68it/s]\n 85%|████████▍ | 1164/1371 [05:03<00:56, 3.68it/s]\n 86%|████████▌ | 1176/1371 [05:06<00:52, 3.70it/s]\n 87%|████████▋ | 1188/1371 [05:09<00:49, 3.70it/s]\n 88%|████████▊ | 1200/1371 [05:12<00:45, 3.72it/s]\n 88%|████████▊ | 1212/1371 [05:16<00:43, 3.70it/s]\n 89%|████████▉ | 1224/1371 [05:19<00:39, 3.70it/s]\n 90%|█████████ | 1236/1371 [05:22<00:36, 3.74it/s]\n 91%|█████████ | 1248/1371 [05:25<00:32, 3.80it/s]\n 92%|█████████▏| 1260/1371 [05:28<00:28, 3.84it/s]\n 93%|█████████▎| 1272/1371 [05:31<00:25, 3.88it/s]\n 94%|█████████▎| 1284/1371 [05:34<00:22, 3.89it/s]\n 95%|█████████▍| 1296/1371 [05:37<00:19, 3.89it/s]\n 95%|█████████▌| 1308/1371 [05:40<00:16, 3.87it/s]\n 96%|█████████▋| 1320/1371 [05:43<00:13, 3.88it/s]\n 97%|█████████▋| 1332/1371 [05:47<00:10, 3.86it/s]\n 98%|█████████▊| 1344/1371 [05:50<00:07, 3.85it/s]\n 99%|█████████▉| 1356/1371 [05:53<00:03, 3.86it/s]\n100%|█████████▉| 1368/1371 [05:56<00:00, 3.89it/s]\n100%|██████████| 1371/1371 [05:57<00:00, 3.88it/s]", "metrics": { "predict_time": 361.181149, "total_time": 361.216568 }, "output": "https://replicate.delivery/pbxt/rERlJsBX0oJ4BZwnJdaj2RfqBYDuzjObx3jRDg3GffHvqQHgA/green-screen.mp4", "started_at": "2022-11-25T14:32:15.627678Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/in5yh3obxrdmvgr6mxgalzzeli", "cancel": "https://api.replicate.com/v1/predictions/in5yh3obxrdmvgr6mxgalzzeli/cancel" }, "version": "2d2de06a76a837a4ba92b6164bf8bfd3ddb524a1fb64b0d8ae055af17fa22503" }
Generated in0%| | 0/1371 [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.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) 1%| | 12/1371 [00:03<06:04, 3.73it/s] 2%|▏ | 24/1371 [00:05<05:13, 4.30it/s] 3%|▎ | 36/1371 [00:08<05:11, 4.28it/s] 4%|▎ | 48/1371 [00:12<05:39, 3.89it/s] 4%|▍ | 60/1371 [00:15<05:41, 3.84it/s] 5%|▌ | 72/1371 [00:18<05:36, 3.86it/s] 6%|▌ | 84/1371 [00:21<05:28, 3.91it/s] 7%|▋ | 96/1371 [00:24<05:22, 3.95it/s] 8%|▊ | 108/1371 [00:27<05:17, 3.98it/s] 9%|▉ | 120/1371 [00:30<05:10, 4.03it/s] 10%|▉ | 132/1371 [00:33<05:07, 4.03it/s] 11%|█ | 144/1371 [00:36<05:05, 4.02it/s] 11%|█▏ | 156/1371 [00:39<05:03, 4.01it/s] 12%|█▏ | 168/1371 [00:42<05:01, 4.00it/s] 13%|█▎ | 180/1371 [00:45<04:57, 4.00it/s] 14%|█▍ | 192/1371 [00:48<04:55, 3.98it/s] 15%|█▍ | 204/1371 [00:51<05:06, 3.81it/s] 16%|█▌ | 216/1371 [00:54<05:03, 3.80it/s] 17%|█▋ | 228/1371 [00:57<04:58, 3.82it/s] 18%|█▊ | 240/1371 [01:00<04:53, 3.85it/s] 18%|█▊ | 252/1371 [01:04<04:51, 3.84it/s] 19%|█▉ | 264/1371 [01:07<04:47, 3.85it/s] 20%|██ | 276/1371 [01:10<04:44, 3.84it/s] 21%|██ | 288/1371 [01:13<04:43, 3.82it/s] 22%|██▏ | 300/1371 [01:16<04:42, 3.79it/s] 23%|██▎ | 312/1371 [01:19<04:36, 3.83it/s] 24%|██▎ | 324/1371 [01:23<04:39, 3.75it/s] 25%|██▍ | 336/1371 [01:26<04:36, 3.74it/s] 25%|██▌ | 348/1371 [01:29<04:33, 3.74it/s] 26%|██▋ | 360/1371 [01:32<04:28, 3.77it/s] 27%|██▋ | 372/1371 [01:35<04:23, 3.79it/s] 28%|██▊ | 384/1371 [01:39<04:20, 3.79it/s] 29%|██▉ | 396/1371 [01:42<04:16, 3.80it/s] 30%|██▉ | 408/1371 [01:45<04:12, 3.82it/s] 31%|███ | 420/1371 [01:48<04:09, 3.81it/s] 32%|███▏ | 432/1371 [01:51<04:04, 3.84it/s] 32%|███▏ | 444/1371 [01:54<04:01, 3.83it/s] 33%|███▎ | 456/1371 [01:57<03:57, 3.85it/s] 34%|███▍ | 468/1371 [02:00<03:55, 3.83it/s] 35%|███▌ | 480/1371 [02:04<03:59, 3.72it/s] 36%|███▌ | 492/1371 [02:07<03:56, 3.72it/s] 37%|███▋ | 504/1371 [02:10<03:53, 3.72it/s] 38%|███▊ | 516/1371 [02:14<03:51, 3.69it/s] 39%|███▊ | 528/1371 [02:17<03:47, 3.71it/s] 39%|███▉ | 540/1371 [02:20<03:40, 3.76it/s] 40%|████ | 552/1371 [02:23<03:37, 3.77it/s] 41%|████ | 564/1371 [02:26<03:35, 3.75it/s] 42%|████▏ | 576/1371 [02:30<03:31, 3.75it/s] 43%|████▎ | 588/1371 [02:33<03:30, 3.73it/s] 44%|████▍ | 600/1371 [02:36<03:26, 3.73it/s] 45%|████▍ | 612/1371 [02:39<03:21, 3.77it/s] 46%|████▌ | 624/1371 [02:42<03:16, 3.80it/s] 46%|████▋ | 636/1371 [02:45<03:11, 3.84it/s] 47%|████▋ | 648/1371 [02:48<03:07, 3.85it/s] 48%|████▊ | 660/1371 [02:51<03:02, 3.89it/s] 49%|████▉ | 672/1371 [02:54<02:59, 3.90it/s] 50%|████▉ | 684/1371 [02:57<02:56, 3.89it/s] 51%|█████ | 696/1371 [03:00<02:50, 3.95it/s] 52%|█████▏ | 708/1371 [03:03<02:47, 3.95it/s] 53%|█████▎ | 720/1371 [03:06<02:43, 3.97it/s] 53%|█████▎ | 732/1371 [03:09<02:41, 3.97it/s] 54%|█████▍ | 744/1371 [03:13<02:38, 3.94it/s] 55%|█████▌ | 756/1371 [03:16<02:35, 3.96it/s] 56%|█████▌ | 768/1371 [03:19<02:32, 3.96it/s] 57%|█████▋ | 780/1371 [03:22<02:34, 3.82it/s] 58%|█████▊ | 792/1371 [03:25<02:32, 3.80it/s] 59%|█████▊ | 804/1371 [03:28<02:29, 3.79it/s] 60%|█████▉ | 816/1371 [03:32<02:26, 3.78it/s] 60%|██████ | 828/1371 [03:35<02:23, 3.79it/s] 61%|██████▏ | 840/1371 [03:38<02:20, 3.79it/s] 62%|██████▏ | 852/1371 [03:41<02:15, 3.83it/s] 63%|██████▎ | 864/1371 [03:44<02:11, 3.87it/s] 64%|██████▍ | 876/1371 [03:47<02:09, 3.83it/s] 65%|██████▍ | 888/1371 [03:50<02:06, 3.82it/s] 66%|██████▌ | 900/1371 [03:53<02:02, 3.86it/s] 67%|██████▋ | 912/1371 [03:56<01:57, 3.90it/s] 67%|██████▋ | 924/1371 [03:59<01:54, 3.92it/s] 68%|██████▊ | 936/1371 [04:02<01:50, 3.94it/s] 69%|██████▉ | 948/1371 [04:05<01:46, 3.97it/s] 70%|███████ | 960/1371 [04:08<01:43, 3.98it/s] 71%|███████ | 972/1371 [04:11<01:39, 4.00it/s] 72%|███████▏ | 984/1371 [04:14<01:37, 3.97it/s] 73%|███████▎ | 996/1371 [04:17<01:34, 3.98it/s] 74%|███████▎ | 1008/1371 [04:21<01:33, 3.87it/s] 74%|███████▍ | 1020/1371 [04:24<01:32, 3.80it/s] 75%|███████▌ | 1032/1371 [04:27<01:28, 3.81it/s] 76%|███████▌ | 1044/1371 [04:30<01:25, 3.84it/s] 77%|███████▋ | 1056/1371 [04:33<01:22, 3.82it/s] 78%|███████▊ | 1068/1371 [04:37<01:19, 3.81it/s] 79%|███████▉ | 1080/1371 [04:40<01:16, 3.79it/s] 80%|███████▉ | 1092/1371 [04:43<01:13, 3.78it/s] 81%|████████ | 1104/1371 [04:46<01:10, 3.77it/s] 81%|████████▏ | 1116/1371 [04:50<01:08, 3.70it/s] 82%|████████▏ | 1128/1371 [04:53<01:06, 3.68it/s] 83%|████████▎ | 1140/1371 [04:56<01:02, 3.68it/s] 84%|████████▍ | 1152/1371 [04:59<00:59, 3.68it/s] 85%|████████▍ | 1164/1371 [05:03<00:56, 3.68it/s] 86%|████████▌ | 1176/1371 [05:06<00:52, 3.70it/s] 87%|████████▋ | 1188/1371 [05:09<00:49, 3.70it/s] 88%|████████▊ | 1200/1371 [05:12<00:45, 3.72it/s] 88%|████████▊ | 1212/1371 [05:16<00:43, 3.70it/s] 89%|████████▉ | 1224/1371 [05:19<00:39, 3.70it/s] 90%|█████████ | 1236/1371 [05:22<00:36, 3.74it/s] 91%|█████████ | 1248/1371 [05:25<00:32, 3.80it/s] 92%|█████████▏| 1260/1371 [05:28<00:28, 3.84it/s] 93%|█████████▎| 1272/1371 [05:31<00:25, 3.88it/s] 94%|█████████▎| 1284/1371 [05:34<00:22, 3.89it/s] 95%|█████████▍| 1296/1371 [05:37<00:19, 3.89it/s] 95%|█████████▌| 1308/1371 [05:40<00:16, 3.87it/s] 96%|█████████▋| 1320/1371 [05:43<00:13, 3.88it/s] 97%|█████████▋| 1332/1371 [05:47<00:10, 3.86it/s] 98%|█████████▊| 1344/1371 [05:50<00:07, 3.85it/s] 99%|█████████▉| 1356/1371 [05:53<00:03, 3.86it/s] 100%|█████████▉| 1368/1371 [05:56<00:00, 3.89it/s] 100%|██████████| 1371/1371 [05:57<00:00, 3.88it/s]
Prediction
arielreplicate/robust_video_matting:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bacID43ujwtzsojd2phcc6hw2sbbbsuStatusSucceededSourceWebHardware–Total durationCreatedInput
- input_video
- output_type
- alpha-mask
{ "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "alpha-mask" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", { input: { input_video: "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", output_type: "alpha-mask" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client: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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", input={ "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "alpha-mask" } ) # 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.
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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", "input": { "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "alpha-mask" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-11T17:58:59.726262Z", "created_at": "2022-12-11T17:56:29.408559Z", "data_removed": false, "error": null, "id": "43ujwtzsojd2phcc6hw2sbbbsu", "input": { "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "alpha-mask" }, "logs": "0%| | 0/143 [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 8%|▊ | 12/143 [00:03<00:38, 3.44it/s]\n 17%|█▋ | 24/143 [00:05<00:27, 4.35it/s]\n 25%|██▌ | 36/143 [00:07<00:22, 4.84it/s]\n 34%|███▎ | 48/143 [00:11<00:23, 3.97it/s]\n 42%|████▏ | 60/143 [00:14<00:21, 3.89it/s]\n 50%|█████ | 72/143 [00:17<00:18, 3.93it/s]\n 59%|█████▊ | 84/143 [00:21<00:15, 3.84it/s]\n 67%|██████▋ | 96/143 [00:24<00:12, 3.83it/s]\n 76%|███████▌ | 108/143 [00:27<00:09, 3.88it/s]\n 84%|████████▍ | 120/143 [00:30<00:05, 3.88it/s]\n 92%|█████████▏| 132/143 [00:33<00:02, 3.88it/s]\n100%|██████████| 143/143 [00:36<00:00, 3.85it/s]", "metrics": { "predict_time": 41.630151, "total_time": 150.317703 }, "output": "https://replicate.delivery/pbxt/5wY879GIAWqAJFxBU6UtcHGWNwmnrnLzUgf2G0Jx0XcxYeIQA/alpha-mask.mp4", "started_at": "2022-12-11T17:58:18.096111Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/43ujwtzsojd2phcc6hw2sbbbsu", "cancel": "https://api.replicate.com/v1/predictions/43ujwtzsojd2phcc6hw2sbbbsu/cancel" }, "version": "73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac" }
Generated in0%| | 0/143 [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.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) 8%|▊ | 12/143 [00:03<00:38, 3.44it/s] 17%|█▋ | 24/143 [00:05<00:27, 4.35it/s] 25%|██▌ | 36/143 [00:07<00:22, 4.84it/s] 34%|███▎ | 48/143 [00:11<00:23, 3.97it/s] 42%|████▏ | 60/143 [00:14<00:21, 3.89it/s] 50%|█████ | 72/143 [00:17<00:18, 3.93it/s] 59%|█████▊ | 84/143 [00:21<00:15, 3.84it/s] 67%|██████▋ | 96/143 [00:24<00:12, 3.83it/s] 76%|███████▌ | 108/143 [00:27<00:09, 3.88it/s] 84%|████████▍ | 120/143 [00:30<00:05, 3.88it/s] 92%|█████████▏| 132/143 [00:33<00:02, 3.88it/s] 100%|██████████| 143/143 [00:36<00:00, 3.85it/s]
Prediction
arielreplicate/robust_video_matting:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bacIDoriptsmtjvbmdmcizvc2d3cbgaStatusSucceededSourceWebHardware–Total durationCreatedInput
- input_video
- output_type
- foreground-mask
{ "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "foreground-mask" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client: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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", { input: { input_video: "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", output_type: "foreground-mask" } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client: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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", input={ "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "foreground-mask" } ) # 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.
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:73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac", "input": { "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "foreground-mask" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-11T18:00:17.356261Z", "created_at": "2022-12-11T17:59:46.010875Z", "data_removed": false, "error": null, "id": "oriptsmtjvbmdmcizvc2d3cbga", "input": { "input_video": "https://replicate.delivery/pbxt/Hqikd7afw2c9koZXS8c3v08x0MFXZFhxFPBkd0iHxrEmRVrk/eddie.mp4", "output_type": "foreground-mask" }, "logs": "0%| | 0/143 [00:00<?, ?it/s]\u001b[A\n 8%|▊ | 12/143 [00:01<00:17, 7.64it/s]\u001b[A\n 17%|█▋ | 24/143 [00:03<00:15, 7.82it/s]\u001b[A\n 25%|██▌ | 36/143 [00:04<00:13, 7.74it/s]\u001b[A\n 34%|███▎ | 48/143 [00:07<00:15, 6.05it/s]\u001b[A\n 42%|████▏ | 60/143 [00:09<00:14, 5.70it/s]\u001b[A\n 50%|█████ | 72/143 [00:12<00:13, 5.30it/s]\u001b[A\n 59%|█████▊ | 84/143 [00:14<00:11, 5.09it/s]\u001b[A\n 67%|██████▋ | 96/143 [00:17<00:09, 5.01it/s]\u001b[A\n 76%|███████▌ | 108/143 [00:19<00:07, 5.00it/s]\u001b[A\n 84%|████████▍ | 120/143 [00:22<00:04, 4.84it/s]\u001b[A\n 92%|█████████▏| 132/143 [00:24<00:02, 4.79it/s]\u001b[A\n100%|██████████| 143/143 [00:27<00:00, 4.71it/s]\u001b[A", "metrics": { "predict_time": 31.311155, "total_time": 31.345386 }, "output": "https://replicate.delivery/pbxt/dpw8YGYG4TZwGNYfKAe79EkI4yzj2m6ZzFqheKMp4KPhl5RgA/foreground-mask.mp4", "started_at": "2022-12-11T17:59:46.045106Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/oriptsmtjvbmdmcizvc2d3cbga", "cancel": "https://api.replicate.com/v1/predictions/oriptsmtjvbmdmcizvc2d3cbga/cancel" }, "version": "73d2128a371922d5d1abf0712a1d974be0e4e2358cc1218e4e34714767232bac" }
Generated in0%| | 0/143 [00:00<?, ?it/s] 8%|▊ | 12/143 [00:01<00:17, 7.64it/s] 17%|█▋ | 24/143 [00:03<00:15, 7.82it/s] 25%|██▌ | 36/143 [00:04<00:13, 7.74it/s] 34%|███▎ | 48/143 [00:07<00:15, 6.05it/s] 42%|████▏ | 60/143 [00:09<00:14, 5.70it/s] 50%|█████ | 72/143 [00:12<00:13, 5.30it/s] 59%|█████▊ | 84/143 [00:14<00:11, 5.09it/s] 67%|██████▋ | 96/143 [00:17<00:09, 5.01it/s] 76%|███████▌ | 108/143 [00:19<00:07, 5.00it/s] 84%|████████▍ | 120/143 [00:22<00:04, 4.84it/s] 92%|█████████▏| 132/143 [00:24<00:02, 4.79it/s] 100%|██████████| 143/143 [00:27<00:00, 4.71it/s]
Want to make some of these yourself?
Run this model