Giter VIP home page Giter VIP logo

avatarclip's People

Contributors

dependabot[bot] avatar hongfz16 avatar mingyuan-zhang avatar tianxingwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avatarclip's Issues

stand_pose.npy How to generate

FileNotFoundError: [Errno 2] No such file or directory: '../ShapeGen/output/stand_pose.npy'

@hongfz16
How can I solve this problem,stand pose. How to get npy data

Problem launching example

Hello and thanks for your code.

I've been trying to launch your example of avatar rendering using pretrained model

python main.py --target_txt 'a 3d rendering of a strong man in unreal engine'

I have created conda env using command you've provided. But when I'm launching this command I'm getting

/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/chainer/_environment_check.py:75: UserWarning: 
--------------------------------------------------------------------------------
CuPy (cupy) version 10.5.0 may not be compatible with this version of Chainer.
Please consider installing the supported version by running:
  $ pip install 'cupy>=7.7.0,<8.0.0'
See the following page for more details:
  https://docs.cupy.dev/en/latest/install.html
--------------------------------------------------------------------------------
  requirement=requirement, help=help))
/home/daddywesker/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/clip/clip.py:24: UserWarning: PyTorch version 1.7.1 or higher is recommended
  warnings.warn("PyTorch version 1.7.1 or higher is recommended")
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/daddywesker/3DSynthNN/AvatarCLIP/AvatarGen/ShapeGen/utils.py", line 7, in <module>
    _, _, texture = nr.load_obj(obj_fname, load_texture=True, texture_size=8)
  File "/home/daddywesker/.local/lib/python3.7/site-packages/neural_renderer-1.1.3-py3.7.egg/neural_renderer/load_obj.py", line 183, in load_obj
  File "/home/daddywesker/.local/lib/python3.7/site-packages/neural_renderer-1.1.3-py3.7.egg/neural_renderer/load_obj.py", line 75, in load_textures
  File "/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/chainer/backends/cuda.py", line 427, in to_gpu
    array, lambda arr: _array_to_gpu(arr, device, stream))
  File "/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/chainer/_backend.py", line 19, in _convert_arrays
    return func(array)
  File "/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/chainer/backends/cuda.py", line 427, in <lambda>
    array, lambda arr: _array_to_gpu(arr, device, stream))
  File "/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/chainer/backends/cuda.py", line 468, in _array_to_gpu
    return cupy.asarray(array)
  File "/home/daddywesker/anaconda3/envs/nrend/lib/python3.7/site-packages/cupy/_creation/from_data.py", line 76, in asarray
    return _core.array(a, dtype, False, order)
  File "cupy/_core/core.pyx", line 2266, in cupy._core.core.array
  File "cupy/_core/core.pyx", line 2290, in cupy._core.core.array
  File "cupy/_core/core.pyx", line 2418, in cupy._core.core._array_default
ValueError: Unsupported dtype object
python-BaseException

Any advice?

Well, yes, there is a cupy warning also, but i cannot install cupy of those versions. There is an error which, as i've searched on the web, is fixed in newer versions.

The correspondence between the codebook and the codebook_embedding

Hi,

I'm glad to read your publication and try your released demo. As for motion generation, the essential item should be the correspondence between the codebook and the codebook_embedding. However, when I checked your code, I found that the CLIL features of the decoded poses of the codebook are not equivalent to those of the codebook_embedding. From Fig, 8 of the paper, I found that the CLIP feature of one pose is the sum of multiple CLIP features of different views of that pose. Would you mind describing more details of how to calculate the codebook and codebook_embeding? If you can release the code for extracting codebook_embedding, I will be more than grateful.

Thank you in advance.

Best wishes,
Jack

A very obvious code error in AvatarCLIP/AvatarGen/ShapeGen/main.py

in line 86-91

def load_codebook(fname):
    codebook_dict = torch.load(fname)
    for i in codebook_dict.keys():
        clip_codebook = codebook_dict[i].cuda()
        break
    return i.cuda(), clip_codebook

In this code, the variable i is used to iterate through each key, which presumably should be a string. However, it ultimately returns the string "CUDA". This code obviously cannot run. This issue prevents me from performing Coarse Shape Generation in the Avatar Generation. Additionally, I don't quite understand why the code logic breaks out of the for loop after the first iteration. As a newcomer to programming, I am uncertain about this approach.

Segmentation fault (core dumped)

python main.py --conf confs/motion_ablation/interpolation/argue.conf
2023-02-11 18:15:16.331 | INFO | human_body_prior.tools.model_loader:load_model:97 - Loaded model in eval mode with trained weights: data/vposer/snapshots/V02_05_epoch=13_val_loss=0.03.ckpt
Segmentation fault (core dumped)

when i try to generate pose or motion, i got a "Segmentation fault (core dumped)" problem, how can i deal with this?
A100-40GB , cuda11.0,pytorch 1.7.1

Problem of Motion Generation

ImportError: ('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8')

There were no problems before, but at this point, a problem that has not been seen before appeared:

`Traceback (most recent call last):
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/osmesa.py", line 22, in GL
return ctypesloader.loadLibrary(
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: ('libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 12, in
from visualize import render_pose, render_motion
File "/home/user/AvatarCLIP-main/AvatarAnimate/visualize.py", line 9, in
import pyrender
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/pyrender/init.py", line 3, in
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/pyrender/light.py", line 10, in
from OpenGL.GL import *
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/GL/init.py", line 3, in
from OpenGL import error as _error
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/error.py", line 12, in
from OpenGL import platform, _configflags
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/init.py", line 35, in
_load()
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/init.py", line 32, in _load
plugin.install(globals())
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/osmesa.py", line 66, in GetCurrentContext
function = self.OSMesa.OSMesaGetCurrentContext
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/osmesa.py", line 60, in OSMesa
def OSMesa( self ): return self.GL
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/user/anconda3/envs/AvatarCLIP_1/lib/python3.8/site-packages/OpenGL/platform/osmesa.py", line 28, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8', '/home/user/anconda3/envs/AvatarCLIP_1/lib/libOSMesa.so.8')
`

Has anyone encountered this situation? Is there any solution?

Motion Generation - Unable to load OpenGL library

Thank you for your work.

The avatar generation part works great, but I am facing difficulties with the motion generation part.

For reference:

(AvatarCLIP) eitan.levy@lambda2:~/AvatarCLIP/AvatarAnimate$ python main.py --conf confs/pose_ablation/pose_optimizer/argue.conf
Traceback (most recent call last):
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 25, in GL
mode=ctypes.RTLD_GLOBAL
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: ('libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 12, in
from visualize import render_pose, render_motion
File "/home/eitan.levy/AvatarCLIP/AvatarAnimate/visualize.py", line 9, in
import pyrender
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/pyrender/init.py", line 3, in
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/pyrender/light.py", line 10, in
from OpenGL.GL import *
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/GL/init.py", line 3, in
from OpenGL import error as _error
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/error.py", line 12, in
from OpenGL import platform, _configflags
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/init.py", line 35, in
_load()
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/init.py", line 32, in _load
plugin.install(globals())
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 66, in GetCurrentContext
function = self.OSMesa.OSMesaGetCurrentContext
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 60, in OSMesa
def OSMesa( self ): return self.GL
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 28, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8')
(AvatarCLIP) eitan.levy@lambda2:~/AvatarCLIP/AvatarAnimate$ python3 main.py --conf confs/pose_ablation/pose_optimizer/argue.conf
/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/clip/clip.py:24: UserWarning: PyTorch version 1.7.1 or higher is recommended
warnings.warn("PyTorch version 1.7.1 or higher is recommended")
Traceback (most recent call last):
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 25, in GL
mode=ctypes.RTLD_GLOBAL
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/ctypes/init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: ('libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 12, in
from visualize import render_pose, render_motion
File "/home/eitan.levy/AvatarCLIP/AvatarAnimate/visualize.py", line 9, in
import pyrender
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/pyrender/init.py", line 3, in
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/pyrender/light.py", line 10, in
from OpenGL.GL import *
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/GL/init.py", line 3, in
from OpenGL import error as _error
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/error.py", line 12, in
from OpenGL import platform, _configflags
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/init.py", line 35, in
_load()
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/init.py", line 32, in _load
plugin.install(globals())
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 66, in GetCurrentContext
function = self.OSMesa.OSMesaGetCurrentContext
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 60, in OSMesa
def OSMesa( self ): return self.GL
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in get
value = self.fget( obj )
File "/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/OpenGL/platform/osmesa.py", line 28, in GL
raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'libgcrypt.so.11: cannot open shared object file: No such file or directory', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8', '/home/eitan.levy/anaconda3/envs/AvatarCLIP/lib/libOSMesa.so.8')

I cannot seem to solve this problem.

No module named 'skimage'

Followed instructions, would not run...

(AvatarCLIP) ➜  ShapeGen git:(main) python main.py --target_txt 'a 3d rendering of a strong man in unreal engine'
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    import neural_renderer as nr
  File "/home/user/miniconda3/envs/AvatarCLIP/lib/python3.7/site-packages/neural_renderer/__init__.py", line 3, in <module>
    from .load_obj import load_obj
  File "/home/user/miniconda3/envs/AvatarCLIP/lib/python3.7/site-packages/neural_renderer/load_obj.py", line 6, in <module>
    from skimage.io import imread
ModuleNotFoundError: No module named 'skimage'

Codebook building

Hi, I'm wodering will you release code for training the codebook? (Both for shape generation and motion generation)

Segmentation fault (core dumped) is displayed when running the instructions related to Candidate Poses Generation and Motion Generation.

Input

python main.py --conf confs/motion_ablation/interpolation/argue.conf

Shows:

2023-12-21 12:04:54.293 | INFO | human_body_prior.tools.model_loader:load_model:97 - Loaded model in eval mode with trained weights: data/vposer/snapshots/V02_05_epoch=08_val_loss=0.03.ckpt
Segmentation fault (core dumped)

After running gdb corefile core.25917,shows:

Core was generated by `python main.py --conf confs/pose_ablation/vposer_codebook/run.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f1005e5c82e in ?? (a)
[Current thread is 1 (LWP 25917)].

After that, the bt command is invoked in gdb to display the following information:

(gdb) bt
#0 0x00007f1005e5c82e in ?? ()
#1 0x00007f11a76219dd in ?? ()
#2 0x0000000000000007 in ?? ()
#3 0x00007ffdd010f150 in ?? ()
#4 0x00007ffdd010f100 in ?? ()
#5 0x00007f11a7621067 in ?? ()
#6 0x0000000000000008 in ?? ()
#7 0x00007f11a7620cec in ?? ()
#8 0x0000000000000000 in ?? ()

Try the solutions in issues but it didn't work

Trying to set :
os.environ['PYOPENGL_PLATFORM'] = 'egl'
in file: anaconda3/envs/AvatarCLIP/lib/python3.7/site-packages/pyrender/renderer.py line 10, but it didn't work

AvatarCLIP/AvatarAnimate

class PoseOptimizer(BasePoseGenerator):
"""
This method will directly optimize SMPL theta with the guidance from CLIP
"""
def init(self,
optim_name: Optional[str] = 'Adam',
optim_cfg: Optional[dict] = {'lr': 0.01},
num_iteration: Optional[int] = 500,
**kwargs):
super().init(**kwargs)
self.optim_name = optim_name
self.optim_cfg = optim_cfg
self.num_iteration = num_iteration

def get_pose(self, text_feature: Tensor) -> Tensor:
    pose = nn.Parameter(torch.randn(63, requires_grad=True).to(self.device))
    cls = getattr(torch.optim, self.optim_name)
    optimizer = cls([pose], **self.optim_cfg)
    print(optimizer)
    for i in tqdm(range(self.num_iteration)):
        new_pose = pose.to(self.device)
        clip_feature = self.get_pose_feature(new_pose).squeeze(0)
        loss = 1 - F.cosine_similarity(clip_feature, text_feature, dim=-1)
        # loss = loss.mean()
        torch.autograd.set_detect_anomaly(True)
        optimizer.zero_grad()
        loss.backward()
        optimizer.step()
    return pose_padding(pose.data).to(self.device)

def get_topk_poses(self, text: str) -> Tensor:
    text_feature = self.get_text_feature(text)
    poses = [self.get_pose(text_feature) for _ in range(self.topk)]
    poses = self.sort_poses_by_score(text, poses)
    poses = torch.stack(poses, dim=0)
    return poses

root@autodl-container-60e5119152-54c37f51:~/autodl-tmp/AvatarCLIP/AvatarAnimate# python main.py --conf confs/pose_ablation/pose_optimizer/argue.conf
2023-10-28 14:55:47.830 | INFO | human_body_prior.tools.model_loader:load_model:97 - Loaded model in eval mode with trained weights: data/vposer/snapshots/V02_05_epoch=08_val_loss=0.03.ckpt
Adam (
Parameter Group 0
amsgrad: False
betas: (0.9, 0.999)
eps: 1e-08
lr: 0.01
maximize: False
weight_decay: 0
)
0%| | 0/500 [00:00<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 52, in
main(args.conf)
File "main.py", line 27, in main
candidate_poses = pose_generator.get_topk_poses(text)
File "/root/autodl-tmp/AvatarCLIP/AvatarAnimate/models/pose_generation.py", line 141, in get_topk_poses
poses = [self.get_pose(text_feature) for _ in range(self.topk)]
File "/root/autodl-tmp/AvatarCLIP/AvatarAnimate/models/pose_generation.py", line 141, in
poses = [self.get_pose(text_feature) for _ in range(self.topk)]
File "/root/autodl-tmp/AvatarCLIP/AvatarAnimate/models/pose_generation.py", line 135, in get_pose
loss.backward()
File "/root/miniconda3/lib/python3.8/site-packages/torch/_tensor.py", line 363, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/root/miniconda3/lib/python3.8/site-packages/torch/autograd/init.py", line 173, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Question about the AppearanceGen results

Hi, thanks for sharing your great work in Avatar generation!

After I ran the command to generate avatars, I got a weird thing which is shown as below:
00030000_0_58
00001100_0_58

I tried to generate AbrahamLincoln and Trump, strange "smoke" is also generated behind the avatar, could you please tell me the reason of this problem?

Thank you!

No such file or directory: '../ShapeGen/output/render/transforms_train.json'

I encountered the following problem while executing "# Initilization of the implicit avatar python main.py --mode train --conf confs/base_models/astrongman.conf":
Load data: Begin
Traceback (most recent call last):
File "main.py", line 968, in
runner = Runner(args.conf, args.mode, args.case, args.is_continue)
File "main.py", line 46, in init
self.dataset = SMPL_Dataset(self.conf['dataset'])
File "/hy-tmp/AvatarCLIP-data/AvatarGen/AppearanceGen/models/dataset.py", line 211, in init
with open(os.path.join(self.data_dir, 'transforms_train.json'), 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '../ShapeGen/output/render/transforms_train.json'

Motion Generation

Congratulations @hongfz16 very impactful work to the community. I was amazed by your work. However, I wanted to ask if you can upload Motion generation code and give a guideline of how to use it. Thank you

ConfigFactory.parse_string(conf_text)

Hello @hongfz16 , Thanks for your work. It seems wrong when launch the code.

AppearanceDescription = "Iron Man" #@param {type:"string"}

torch.set_default_tensor_type('torch.cuda.FloatTensor')
FORMAT = "[%(filename)s:%(lineno)s - %(funcName)20s() ] %(message)s"
logging.basicConfig(level=logging.INFO, format=FORMAT)
conf_path = 'confs/examples_small/example.conf'
f = open(conf_path)
conf_text = f.read()
f.close()
conf_text = conf_text.replace('{TOREPLACE}', AppearanceDescription)

print(conf_text)

conf = ConfigFactory.parse_string(conf_text)
print("Prompt: {}".format(conf.get_string('clip.prompt')))
print("Face Prompt: {}".format(conf.get_string('clip.face_prompt')))
print("Back Prompt: {}".format(conf.get_string('clip.back_prompt')))

Shows:

ParseException Traceback (most recent call last)
ParseException: Expected '}', found '=' (at char 1312), (line:67, col:14)

During handling of the above exception, another exception occurred:

ParseSyntaxException Traceback (most recent call last)
in <cell line: 12>()
10 conf_text = conf_text.replace('{TOREPLACE}', AppearanceDescription)
11 # print(conf_text)
---> 12 conf = ConfigFactory.parse_string(conf_text)
13 print("Prompt: {}".format(conf.get_string('clip.prompt')))
14 print("Face Prompt: {}".format(conf.get_string('clip.face_prompt')))

2 frames
/usr/local/lib/python3.10/dist-packages/pyparsing/core.py in parse_string(self, instring, parse_all, parseAll)
1139 else:
1140 # catch and re-raise exception from here, clearing out pyparsing internal stack trace
-> 1141 raise exc.with_traceback(None)
1142 else:
1143 return tokens

ParseSyntaxException: Expected '}', found '=' (at char 1312), (line:67, col:14)

Applying a generated motion on a generated avatar

Hello,

I am not able to understand how to apply a generated motion on a an avatar I generated.

I want to be able get something like: "A skinny ninja that is raising both arms" that you had in the example.

I understand how to generate a skinny ninja, and how to generate a generic man that is raising both arms - but how do I get a skinny ninja that is raising both arms?

Thank you.

getting the textures of the avatars from the gallery

Hi,
I've downloaded the avatars from the gallery (tried both .glb and .fbx formats) and I can't find their textures.
When loading into Blender or Unity the avatar is rendered without textures.
Are the textures in another location I'm missing?

Motion Generation: Generate less than 5 poses thus failing to generate motions.

The config file is:

general {
    base_exp_dir = ./exp/motion_ablation/motion_optimizer/run
    mode = motion
    text = a rendered 3d male is standing depressingly
}

pose_generator {
    type = VPoserCodebook
}

motion_generator {
    type = MotionInterpolation
}

Then the error

Traceback (most recent call last):
File "main.py", line 67, in
main(args.conf)
File "main.py", line 47, in main
motion = motion_generator.get_motion(text, poses=candidate_poses)
File "./AvatarCLIP/AvatarAnimate/models/motion_generation.py", line 128, in get_motion
end_code = candidate_latent_codes[i]
IndexError: index 4 is out of bounds for dimension 0 with size 4"

is displayed.

I think the problem may come from the code in line 327 in AvatarAnimate/models/pose_generation.py

poses = self.suppress_duplicated_poses(poses, threshold=self.filter_threshold)

After "suppress_duplicated_poses", there may be less than k(in this context k=5) poses, thus failing to generate corresponding motions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.