3D Hair Reconstruction
Reconstructs 3D hair from a photo of a person.
1. Getting a token
2. Choice of photo
3. Reconstruct 3D Hair
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'import requests
token = "ENTER_YOUR_TOKEN"
image_path = "ENTER_IMAGE_PATH"
if __name__ == "__main__":
service_url = "https://api.metahumansdk.io/hair_recon"
service_headers = {"accept": "application/json"}
files = {
"token": (None, token),
"image_bytes": ("image", open(image_path, "rb"), "image/png"),
"mode": (None, "card") # card or volume
}
response_config = requests.post(service_url + "/run_pipeline", headers=service_headers, files=files, stream=True)
with open("hair.glb", "wb") as f:
f.write(response_config.content)
4. Check GLB model
Examples of results


card mode
volume modeExample rendering

card mode
volume mode5. Visualization with head


Last updated