Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This script allows to export neural-blend-shapes file (.fbx, .glb)
To get neural-blendshapes model , just simply run
blender -b -P nbs_fbx_output.py -- --input ../demo --output ../demo/output.fbx
To get envelop-only model , just simply run
blender -b -P nbs_fbx_output.py -- --input ../demo --output ../demo/output.fbx --envelope_only 1
#Required
Input direcotry is the directory where the ouputs are generated from 'demo.py'
'T-pose.obj', 'skeleton.bvh' , 'weight.npy' and 'basis.npy' , 'coff.npy' should exist in input directory (e.g. ../demo)
If 'basis.npy' , 'coff.npy' don't exist , envelope-only model will be exported.
'basis.npy' and 'coff.npy' (that is required to get neural-blend-shape model) can be achieved from params called basis_full, coff respectively in ./architecture/blend_shapes.py
e.g. I simply add this code in the forward function in ./architecture/blend_shapes.py
import numpy as np
np_basis = basis_full.detach().cpu().numpy()
np_coff = coff.detach().cpu().numpy()
np.save('./demo/basis.npy',np_basis)
np.save('./demo/coff.npy',np_coff)