Virtual Background

Virtual Background

Virtual Background allows to change or remove completely the background of the photo or video.

You can select severa replacement background, blur or make existing background blak and white.

You can download or copy image using right-click.

Virtual Background technology is available for autoring videos for online streaming or in use with real-time video conferencing applications like Zoom.

%!s()

Request parameters

Description
Parameter’s name Parameter’s type Description
out_filters string Optional. Comma separated list of model outputs to return.
inputs image Input image
object_class string Object to find
effect string Effect to apply
background string New Background
blur_radius int Blurring radius for Blur
curl-form
curl -X POST \
    -H 'Authorization: Bearer YOUR_USER_TOKEN' \
    -H 'Content-Type: multipart/form-data' \
    -F "out_filters=output" \
    -F "inputs=inputs_value" \
    -F "object_class=object_class_value" \
    -F "effect=effect_value" \
    -F "background=background_value" \
    -F "blur_radius=blur_radius_value" \
    https://cloud.kibernetika.io/api/v0.2/workspace/kuberlab-demo/serving/photo-robot/form-data
curl-json
curl -X POST \
    -H 'Authorization: Bearer YOUR_USER_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '
      {
        "background": "background_value",
        "blur_radius": 90,
        "effect": "effect_value",
        "inputs": "base64_encoded_inputs_contents",
        "object_class": "object_class_value"
      }
    '
    https://cloud.kibernetika.io/api/v0.2/workspace/kuberlab-demo/serving/photo-robot/proxy
python
import kclient
from kclient.utils import client, request


cl = client.with_bearer_token("YOUR_USER_TOKEN")
serving_api = kclient.api.serving_api.ServingApi(cl)

data = request.make(data={
    "object_class": "[Person]",
    "effect": "[Grey[https://storage.googleapis.com/edwindemo/photo/katya-grey.png] Blur[https://storage.googleapis.com/edwindemo/photo/katya-blur.png] Remove background[https://storage.googleapis.com/edwindemo/photo/katya-back.png]]",
    "background": "[None[https://storage.googleapis.com/gallery-kibernetika-ai/backgrounds/black.jpg] Beach1[https://storage.googleapis.com/gallery-kibernetika-ai/backgrounds/Beach1.jpg] Hell1[https://storage.googleapis.com/gallery-kibernetika-ai/backgrounds/Hell1.jpg]]",
    "blur_radius": 3,
}, files={
    "inputs": "/path/to/inputs_file",
})
resp = serving_api.serving_proxy(data, "kuberlab-demo", "photo-robot")

Response format

{
  "output": "base64_encoded_image"
}