Create an Avatar at runtime

How do you create an avatar for mecanim at runtime? I looked at Unity - Scripting API: AvatarBuilder.BuildGenericAvatar but their example creates an empty avatar. I need a working example.
159143-unity-nxup3bllkt.png
159144-unity-ivctfzfvyq.png

There is no API on avatars for manual configuration.

Even I am looking for the same solution that, create an avatar runtime using the photo uploaded. I am not able to achieve that using BuildHumanAvatar or Build GebericAvatar.

If anyone figured it already, please help me.

Even I am also trying to achieve this to create an avatar runtime using the photo uploaded, if anyone would have already figured it please help me.