brjathu / PHALP

Code repository for the paper "Tracking People by Predicting 3D Appearance, Location & Pose". (CVPR 2022 Oral)
Other
282 stars 43 forks source link

Hi, there was a problem with the rendering of the video results. #35

Closed yanmn closed 4 months ago

yanmn commented 4 months ago

I find an error in py_renderer.py line120 :

operands could not be broadcast together with shapes (1280,1280,3) (1280,1280,0) Traceback (most recent call last): File "phalp/trackers/PHALP.py", line 252, in track rendered_, f_size = self.visualizer.render_video(final_visuals_dic[frame_key]) File "phalp/visualize/visualizer.py", line 359, in render_video rendered_image_final, valid_mask = self.render_single_frame( File "phalp/visualize/visualizer.py", line 77, in render_single_frame rgb_from_pred, validmask = self.render.visualize_all(pred_vertices.numpy(), pred_cam_t_bs.cpu().numpy(), color, image, use_image=use_image) File "phalp/visualize/py_renderer.py", line 120, in visualize_all output_img = color[:, :, :3] * valid_mask + (1 - valid_mask) * images ValueError: operands could not be broadcast together with shapes (1280,1280,3) (1280,1280,0)

So, I forced to unify the dimensions.

`118 valid_mask = color[:,:,3:4]

  119   if valid_mask.shape[-1] == 0:

  120       valid_mask = np.ones((valid_mask.shape[0], valid_mask.shape[1], 1), dtype=valid_mask.dtype)

  121   if(use_image):

  122       output_img = color[:, :, :3] * valid_mask + (1 - valid_mask) * images`

As a result, there is no video picture.

Snipaste_2024-05-15_18-42-38

How to solve this problem? Why is the error "operands could not be broadcast together with shapes (1280,1280,3) (1280,1280,0)"?

geopavlakos commented 4 months ago

What is the original video that created this issue for you?

yanmn commented 4 months ago

What is the original video that created this issue for you?

The original video comes with the project: assets/videos/vid.mp4

geopavlakos commented 4 months ago

The provided video is expected to work out of the box. Is it possible that there is some problem with your installation? Could you try with a clean virtual environment?

yanmn commented 4 months ago

I have solved this problem, thank you very much for your answer!

Are PHALP_v2 and PHALP_v2_pymafx open source?

def get_tracker(cfg):     from phalp.trackers.PHALP import PHALP     """Get the tracker object from the config."""     if cfg.base_tracker == "PHALP":         return PHALP(cfg)     elif cfg.base_tracker == "PHALP_v2":         return PHALP_v2(cfg)     elif cfg.base_tracker == "PHALP_v2_pymafx":         return PHALP_v2_pymafx(cfg)     else:         raise ValueError("Unknown tracker")

yanming @.***

 

------------------ 原始邮件 ------------------ 发件人: "brjathu/PHALP" @.>; 发送时间: 2024年5月22日(星期三) 晚上11:07 @.>; @.**@.>; 主题: Re: [brjathu/PHALP] Hi, there was a problem with the rendering of the video results. (Issue #35)

The provided video is expected to work out of the box. Is it possible that there is some problem with your installation? Could you try with a clean virtual environment?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>