xingyizhou / CenterTrack

Simultaneous object detection and tracking using center points.
MIT License
2.39k stars 526 forks source link

Can not open the videos #241

Open DEEPMINDing opened 3 years ago

DEEPMINDing commented 3 years ago

I used the fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') and fourcc = cv2.VideoWriter_fourcc(*'XVID'),But the results video still won't open

DEEPMINDing commented 3 years ago

I solved the problem by changing video_wh and save_framerate

RATHOD-SHUBHAM commented 2 years ago

This worked for me.

Note : create a folder CenterTrack/results

In demo.py file Line 48:

change this

if opt.save_video:
  fourcc = cv2.VideoWriter_fourcc(*'XVID')
  out = cv2.VideoWriter('results/{}.mp4'.format(
  opt.exp_id + '_' + out_name),fourcc, opt.save_framerate, (opt.video_w, opt.video_h))

to this

if opt.save_video:
    fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
    out = cv2.VideoWriter('results/{}'.format(
      opt.exp_id + '_' + out_name),fourcc, opt.save_framerate, (
        opt.video_w, opt.video_h))

Use this Command to run

Specify the height and width of video : --video_h 450 --video_w 800 !python src/demo.py tracking,ddd --load_model models/nuScenes_3Dtracking.pth --dataset nuscenes --pre_hm --track_thresh 0.1 --demo videos/nuscenes_mini.mp4 --test_focal_length 633 --video_h 450 --video_w 800 --save_video