Local Compute Avatar SDK  3.0.1
To generate Full Body avatars
Parameters Description

AvatarSdkParams structure specifies avatar's generation parameters.
There are three types of parameters: General, Computation Parameters and Export Parameters.

General

General parameters includes:

struct AvatarSdkParams
{
char* inputImagePath; // Path to the photo in the PNG or JPEG format.
wchar_t* wInputImagePath; // Path to the photo in UTF16 encoding. Works only on Windows platform.
char* outputDirPath; // Directory to store an output result.
char* intermediateDataDirPath; // Directory to store intermediate data for subsequent exports.
char* computationParamsJsonFilePath; // Path to the computation parameters JSON file.
char* exportParamsJsonFilePath; // Path to the export parameteres JSON file.
...
}

Computation Parameters

These parameters are a set of flags and options to fine-tune the avatar computation process. Computations parameters include three sections: Model Info, Avatar Modifications, Body Shape.

struct AvatarSdkComputationParams
{
AvatarSdkModelInfo modelInfo; // Meta-information about computed avatar. The generated data is stored in the model.json file in the output directory.
AvatarModifications avatarModifications; // Requested avatar modifications
AvatarSdkBodyShape bodyShape; // Avatar's body shape configuration
};

Model Info

The Model Info contains flags that specify which meta-information should be computed for an avatar. The generated meta-information is stored in the model.json file in the output directory or can be accessed with the getAvatarModelInfo method.
More detailed information about Model Info parameters can be found in our Web Api Documentation.

struct AvatarSdkModelInfo
{
bool age; // Classify a person's age from a source photo
bool gender; // Predict person's gender from a source photo.
bool race; // Predict person's race from a source photo.
bool eyeScleraColor; // Compute average eye sclera color from a source photo.
bool eyeIrisColor; // Compute average eye iris color from a source photo.
bool skinColor; // Compute average skin color from a source photo
bool hairColor; // Compute average haircut color from a source photo.
bool facialLandmarks68; // Compute facial landmarks
};

Avatar Modifications

Parameters are used to configure an avatar appearance.
More information about Avatar Modifications parameters can be found in our Web Api Documentation

struct AvatarModifications
{
bool enhanceLighting; // Attempt to make lighting more uniform on the source photo
bool removeGlasses; // Attempt to remove glasses on the source photo before the actual avatar computation start
bool removeSmile; // Attempt to remove a smile on the source photo before the actual avatar computation start.
bool removeStubble; // Attempt to remove a stubble on the source photo before the actual avatar computation start.
bool parametricEyesTexture; // Replace eye texture from a source photo with generated one with sclera and iris colors to match the photo version.
AvatarSdkColorRgb eyeIrisColor; // Recolor eye iris directly on a model texture. Works only when parametricEyesTexture is set.
AvatarSdkColorRgb eyeScleraColor; // Recolor eye sclera directly on a model texture. Works only when parametricEyesTexture is set.
AvatarSdkColorRgb teethColor; // Recolor teeth directly on a model texture.
int generatedHaircutFacesCount; // Resample generated haircut mesh to have specified faces count.
AvatarSdkSize generatedHaircutTextureSize; // Resize generated haircut texture to the specified size. Original haircut texture size is 1024x1024 px.
};

Body Shape

The "Body Shape" parameters are used to configure some body shape measurements such as gender, weight, height, etc. Parameters that are not specified will be predicted from an input photo.
More information about Body Shape parameters can be found in our Web Api Documentation.

struct AvatarSdkBodyShape
{
AvatarGender gender; // Expected model's gender. Available values are FEMALE, MALE, and NON_BINARY. If not defined, gender is autodetected.
float height; // Expected model's height in centimeters, greater than zero. If value is negative, height is predicted.
float weight; // Expected model's weight in kilograms, greater than zero. If value is negative, weight is predicted.
float chest; // Expected model's chest girth in centimeters, greater than zero. If value is negative, chest girth is predicted.
float waist; // Expected model's waist girth in centimeters, greater than zero. If value is negative, waist girth is predicted.
float hips; // Expected model's hips girth in centimeters, greater than zero. If value is negative, hips girth is predicted.
};

Export Parameters

These parameters configures an output format, textures and assets such as haircuts, outfits and blendshapes.
More information about export parameters can be found in our Web Api Documentation.

struct AvatarSdkExportParams
{
AvatarSdkFormat format; // File format for the body mesh.
bool pointclouds; // If set to true, then the resulting model file will not contain mesh faces and UV-mapping (i.e. it will contain only mesh vertices).
bool normalMap; // Generate normal map texture for avatar
bool roughnessMap; // Generate roughness map texture for avatar
bool metallicMap; // Generate metallic map texture for avatar
bool embedTextures; // If format supports textures embedding (i.e. fbx or glb), this flag indicates whether to embed textures or store them as separate files.
AvatarSdkSize textureSize; // Body textures size. If the value isn't specified, default size is 4096x2048 px.
AvatarSdkTemplate bodyTemplate; // Template specifies whcih parts of the body are generated. Available values: full body and head.
int lod; // Level of details for the body mesh. Possible values are 0-7.
AvatarSdkHaircutsParams haircutsParams; // Haircuts parameters
AvatarSdkOutfitsParams outfitsParams; // Outfits parameters
AvatarSdkBlendshapesParams blendshapesParams; // Blendshapes parameters
};

Haircuts

AvatarSdkHaircutsParams is used to configure a list of haircuts to be generated and their output format.
To get a full list of available haircuts, use the getAvailableHaircuts method.

struct AvatarSdkHaircutsParams
{
AvatarSdkFormat format; // File format for the haircut meshes. If FORMAT_NOT_DEFINED, format will be used the same as specified for the body mesh.
bool embed; // If body format supports sub-meshes (i.e. fbx, gltf, glb) this flag indicates whether to embed haircuts meshes into the avatar or store these meshes as separate files.
bool embedTextures; // If format supports textures embedding (i.e. fbx or glb), this flag indicates whether to embed textures or store them as separate files.
bool pointclouds; // If set to true, then the resulting model file will not contain mesh faces and UV-mapping (i.e. it will contain only mesh vertices).
AvatarSdkColorRgb color; // Color of the haircuts (except generated).
AvatarSdkSize textureSize; // Haircut textures size.
...
};

Outfits

AvatarSdkOutfitsParams is used to configure a list of outfits to be generated and their output format.
To get a full list of available outfits, use the getAvailableOutfits method.

struct AvatarSdkOutfitsParams
{
AvatarSdkFormat format; // File format for the outfits meshes. If FORMAT_NOT_DEFINED, format will be used the same as specified for the body mesh.
bool embed; // If body format supports sub-meshes (i.e. fbx, gltf, glb) this flag indicates whether to embed outfits meshes into the avatar or store these meshes as separate files.
bool embedTextures; // If format supports textures embedding (i.e. fbx or glb), this flag indicates whether to embed textures or store them as separate files.
bool pointclouds; // If set to true, then the resulting model file will not contain mesh faces and UV-mapping (i.e. it will contain only mesh vertices).
AvatarSdkSize textureSize; // Outfit textures size.
bool normalMap; // Generate normal map texture for an outfit.
bool roughnessMap; // Generate roughness map texture for an outfit.
bool metallicMap; // Generate metallic map texture for an outfit.
bool bodyVisibilityMask; // Mask that indicates which parts of the body are hidden under the outfit.
...
};

Blendshapes

AvatarSdkBlendshapesParams is used to configure a list of blendshapes sets to be generated and their output format.
Blendshapes can be saved in the BIN format, that specifies the consequent vertices for the body mesh as a floating-point values (X, Y, Z).
To get a full list of available blendshapes sets, use the getAvailableBlendshapes method.

struct AvatarSdkBlendshapesParams
{
AvatarSdkFormat format; // File format for the blendshapes meshes. If FORMAT_NOT_DEFINED, format will be used the same as specified for the body mesh.
bool embed; // If body format supports sub-meshes (i.e. fbx, gltf, glb) this flag indicates whether to blendshapes meshes into the avatar or store these meshes as separate files.
bool pointclouds; // If set to true, then the resulting model file will not contain mesh faces and UV-mapping (i.e. it will contain only mesh vertices).
...
};