Unity-Technologies / com.unity.cv.synthetichumans

A package for creating Unity Perception compatible synthetic people.
Other
102 stars 20 forks source link

How to generate a human character with different clothes? #9

Closed YunjiePeng closed 1 year ago

YunjiePeng commented 1 year ago

Hello, it is greatly appreciated for your wonderful work in promoting the development of computer vision.

Can I generate a human with different clothes based on com.unity.cv.synthetichumans? (e.g., human A with clothes B, human A with clothes C, human A with clothes D, etc.). Is there a possibility?

I have checked the original script file and found that the clothing is controlled by "generationAssetRefs.clothingTags". Any idea for building the customized HumanGenerationRandomizer? Would you please provide a sample file to support the need for cloth changing to boost recognition tasks in computer vision?

csun commented 1 year ago

Hey Yunjie, just wanted to clarify what you're asking:

It sounds like you want to be able to regenerate the same exact human body / face but only change their clothing. Is that a correct interpretation?

YunjiePeng commented 1 year ago

Hi Cameron, what you interpreted is exactly what I want.

Actually, I have found the class HumanGenerator which contains functions named "ReviewAndAssignClothingTags" and "GenerateClothes", where clothingTags are randomly generated and corresponding clothing items are created.

Therefore, I try to write a new class similar to "HumanGenerator" to provide a public function for changing clothes on a human (i.e., instantiated from generationConfig.basePrefab).

Here comes a question when new clothes are generated, the previous old clothes still exit. How can I remove the old clothes and some repeated generated "root"? Is there a way to get old clothes and delete them during the generation of different clothes on the same human body?

YunjiePeng commented 1 year ago

The screenshot is pasted as follows. WechatIMG1991

YunjiePeng commented 1 year ago

Thanks a million to your wonderful work, I have finally realized it by customizing my own "HumanGenerator". The framework of Synthetic Human is well-designed and easy to use for building customized dataset.

Old clothes can be easily removed by "transform.Find()" and "Object.DestroyImmediate()".

csun commented 1 year ago

Glad you found a solution, and thanks for your kind words!