3D Hair Reconstruction
Reconstructs 3D hair from a photo of a person.
1. Getting a token
2. Choice of photo
Choose a photo of a person.
Note: The quality of the photo must be a good resolution.
Note: Hair should be clearly visible.
Note: So far, we are unable to work well with ponytails and pigtails.
3. Reconstruct 3D Hair
Make a request by sending your chosen photo. Make sure you are using the mode you really need. 'card' mode is used by default.
token="ENTER_YOUR_TOKEN"
image_path="ENTER_IMAGE_PATH"
curl -X 'POST' \
'https://api.metahumansdk.io/hair_recon/run_pipeline' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "token=$token" \
-F "image_bytes=@$image_path;type=image/png" > hair.glb \
-F 'mode=card'The expected result is the hair.glb file.
4. Check GLB model
Check saved file in GLB viewer (for example in Blender).
Examples of results
Open in Blender


card mode
volume modeExample rendering
Rendering in Blender

card mode
volume mode5. Visualization with head
In order to get a 3D model of the head with hair, we will use GLB Constructor:
GLB Constructor currently supports only hair involume mode
token="ENTER_YOUR_TOKEN"
curl -X 'POST' 'https://api.metahumansdk.io/glb_const/assemble' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F "token=$token" \
-F '[email protected];type=image/png' \
-F 'head_config=@head_config.json;type=application/json' \
-F '[email protected];type=image/png' \
-F 'add_facs=true' > head.glbAfter the completed stages, you get a glb model head.glb .
Result:


Last updated