API
...
Digital Human Configuration
Creating Head Visuals
Changing Digital Human Backgrounds
16min
this document describes how to use the api to replace the background of a digital human with a static image this feature allows for greater customization and flexibility in how digital humans are presented the ability to change backgrounds is currently available for a select group of head visuals only to find the head visual id you'd like to use, please refer to the table below overview the process of changing the background involves several steps, including identifying head visual id with repleceable background, uploading an image, triggering the background replacement and finally creating and configuring a head visual process flow the following endpoints are used in the background replacement process 1\ identify a head visual id with replaceable background we've created head visuals with associated assets that allow easy background replacement please identify the head visual id you would like to replace background to using the folowing table name avatar head visual id amy 7a2379c8 1c53 4d1e 9fe4 b9af7f3b6534 ava e5c6f5d6 6e6e 4ce5 872d 159bcf2255d9 hal 7af4cbe9 8702 4af8 9c55 e90cee6bfe02 jo f0a341dd 206d 4786 849b be587a8335dc kai 1 8810c132 3c67 4b6f 8990 8b822c82e450 kai 2 41fa882a 2c0c 400a bce0 c7b45dd3ac85 kai 3 f15bcc91 6f7b 4db5 a39c 8cc55d0c9a8a lev 1 605bc559 687a 47cb b31a 4701c322d8ff lev 2 aaa009b7 a54b 472b 922d 51e089390d70 noa 1 17eaa273 bfa0 4f1b 82ad dcb4a21a9903 noa 2 b799fe4e f051 4b3a 87bd f103b9b8649c pia 3fb6c88a b568 4cea adf2 7d4156fd3ded if you are interested in creating a completely new head visual with replaceable background, please contact us 2\ upload replacement image endpoint /image/upload method post description uploads the static image that will be used to replace the background request body (multipart/form data) curl x 'post' \\ 'https //platform api unith ai/image/upload' \\ h 'accept application/json' \\ h 'authorization bearer yourbearertoken \\ h 'content type multipart/form data' \\ f 'file=@dolphinwallpaper jpg;type=image/jpeg' response token a temporary token for the uploaded image error handling invalid file type ( png, jpg, jpeg are allowed) file size exceeds the maximum allowed limit 3\ replace background endpoint /head visual/replace background method post description initiates the background replacement process request body curl x 'post' \\ 'https //platform api unith ai/head visual/replace background' \\ h 'accept application/json' \\ h 'x head image token id imagetoken \\ h 'authorization bearer yourbearertoken \\ h 'content type application/json' \\ d '{ "id" "yourheadvisualid" }' parameters x head image token id ( header )(string, required) the id of the head visual image token (string, required) the token of the uploaded replacement image response a json object containing the url of the new idle video with the replaced background for example error handling handle errors related to the background replacement, including invalid head visual id invalid image token 4\ upload new video with replaced background endpoint /video/upload method post description upload the new video with replaced background request body (multipart/form data) curl x 'post' \\ 'https //platform api unith ai/video/upload' \\ h 'accept application/json' \\ h 'authorization yourbearertoken \\ h 'content type multipart/form data' \\ f 'file=@yourvideo mp4;type=video/mp4' response token a temporary token for the uploaded video this token is used in subsequent steps error handling invalid file type ( mp4 allowed) file size exceeds the maximum allowed limit 5\ create head visual with new replaced background endpoint /head visual/create method post description creates a new head visual using the video with replaced background request body curl x 'post' \\ 'https //platform api unith ai/head visual/create' \\ h 'accept application/json' \\ h 'x head video token id yourvideotoken' \\ h 'authorization bearer yourbearertoken' \\ h 'content type application/json' \\ d '{ "update" false, "detector version" "v2", "detector threshold" 0 2, "mode" "default", "cut timestamp" 0 1, "debug" false }' parameters include all the required parameters for the /head visual/create endpoint detector version (string) you may or may not need to include it here, depending on your logic response a json object containing the details of the newly created head visual, including its unique id error handling invalid video token ensure cut timestamp is provided when the processor mode is two loops 6\ save head visual endpoint /head visual/save method post description saves the newly created head visual request body curl x 'post' \\ 'https //platform api unith ai/head visual/save' \\ h 'accept application/json' \\ h 'authorization yourbearertoken' \\ h 'content type application/json' \\ d '{ "id" "yourheadvisualid", "name" "headvisualname", "gender" "female", "type" "talk" }' parameters include all the required parameters for the /head visual/save endpoint response a json object indicating the head visual has been saved error handling ensure the task exist for a given head visual id check the task status is in progress 7\ assign new head visual id to your organization endpoint /head visual/assign organisation method put description assigns the newly created head visual toy our organization request body curl x 'put' \\ 'https //platform api unith ai/head visual/assign organisation' \\ h 'accept / ' \\ h 'authorization bearer yourbearertoken \\ h 'content type application/json' \\ d '{ "id" "yourheadvisualid", "orgids" \[ "yourorgid" ] }' parameters include all the required parameters for the /head visual/assign organisation endpoint response a json object indicating the head visual has been assigned error handling ensure the task exist for a given head visual id and org id other considerations asynchronous processing background replacement involves synchronous processing head visual creation, preprocessing of the video etc