yerfor / GeneFace

GeneFace: Generalized and High-Fidelity 3D Talking Face Synthesis; ICLR 2023; Official code
MIT License
2.52k stars 294 forks source link

Does infer_once function use GPU when loading in sample into get_pose_from_ds() #218

Open JieLuChen opened 11 months ago

JieLuChen commented 11 months ago

@yerfor

This function here (in base_nerf_infer.py) `

def infer_once(self, inp):

    self.inp = inp
    print('this is the infer once')
    self.use_pred_pose = True if self.inp.get('c2w_name','') != '' else False
    print('this is the infer second')
    samples = self.get_cond_from_input(inp)
    print('this is the infer third samples')
    batches = self.get_pose_from_ds(samples)
    print('this is the batches')
    image_dir = self.forward_system(batches)
    if self.proc_rank == 0:
        out_name = self.postprocess_output(image_dir)
        print(f"The synthesized video is saved at {out_name}")          

`
Does batches = self.get_pose_from_ds(samples) use GPU? During this time I see CPU Usage go up to 100% Running on A100 80gb CUDA 11.3

I do see GPU Usage go up for other stuff but for this bit the function takes a long time over 10-15 minutes and this just for 30 second wav file.