EricGuo5513 / momask-codes

Official implementation of "MoMask: Generative Masked Modeling of 3D Human Motions (CVPR2024)"
https://ericguo5513.github.io/momask/
MIT License
856 stars 73 forks source link

Tiny bug in the Demo script #83

Closed Xinyu-bot closed 3 weeks ago

Xinyu-bot commented 1 month ago

Saying "no motion length are specified" for python gen_t2m.py --gpu_id 1 --ext exp2 --text_path ./assets/text_prompt.txt as long as the text_prompt.txt file contains the new line character \n.

            for line in lines:
                infos = line.split('#')
                prompt_list.append(infos[0])
                if len(infos) == 1 or (not infos[1].isdigit()):
                    est_length = True
                    length_list = []
                else:
                    length_list.append(int(infos[-1]))

The problem here is that infos[1] is going to be <Number>\n after the split by '#' and therefore never pass the isdigit() check. Adding line.strip() before the split should fix this.

            for line in lines:
                line = line.strip()
                infos = line.split('#')
Murrol commented 3 weeks ago

Thanks! This is a great fix.