Tf-pose-estimation: how to run this on mp4 videos?

Created on 21 Jun 2020  路  7Comments  路  Source: ildoonet/tf-pose-estimation

hi,i want to run this algorithm of mp4 videos,can u please help me?how can i do that?

Most helpful comment

@ildoonet
I got it to work... There was not much that I had to change though.
Here is what worked for me:

  1. Replaced this line in run_video.py: humans = e.inference(image) WITH the following line that matches what is in the run_webcam.py
    humans = e.inference(image, resize_to_default=(w > 0 and h > 0), upsample_size=args.resize_out_ratio)
  1. And further, also added the following line at the top, along with the rest of the parser statements,
    parser.add_argument('--resize-out-ratio', type=float, default=4.0,
    help='if provided, resize heatmaps before they are post-processed. default=1.0')
  2. (Optional) I also changed the the waitKey time to what woks for my requirements to this: cv2.waitKey(10) == ord('q'):
  3. Finally, remember to specify the video file name when calling run_video.py file.

After these steps, I got the expected output. The stick figure was showing on top of the human figure in the video.

All 7 comments

same

You can run run_video.py with video path mentioned

python run_video.py --model=mobilenet_thin --video=./videos/yourvideo.mp4

you can also specify resolution of the video . Please check run_video for more details

Hi,
I run the "run_video.py" on mp4 video but the output is not marked. No skeleton graph is drawn on the frame.
Any idea? Thanks

Hi,
I run the "run_video.py" on mp4 video but the output is not marked. No skeleton graph is drawn on the frame.
Any idea? Thanks

Hi,
Have you solve this problem? I met same problem. No skeleton graph is drawn on the result video. But run.py result image works for me.

Hi, I am running into the same issue. On taking a closer look at the run_video.py , tried logging the humans = e.inference(image) , it returns an empty array in here, while the same function call returns an array a body-part for run.py. Is the model unable to identify the presence of a person in this case for some reason? It seems to work just fine on run_webcam.py as well.Facing this issue only on run_video.py

I could not figure out why this issue occurs with the run_video.py but I managed to get it working on an mp4 file by changing the input stream from webcam to a .mp4 file by changing the run_webcam.py file
(change line 49 to cam = cv2.VideoCapture('myvideo.mp4') ) and works just as expected.

@ildoonet
I got it to work... There was not much that I had to change though.
Here is what worked for me:

  1. Replaced this line in run_video.py: humans = e.inference(image) WITH the following line that matches what is in the run_webcam.py
    humans = e.inference(image, resize_to_default=(w > 0 and h > 0), upsample_size=args.resize_out_ratio)
  1. And further, also added the following line at the top, along with the rest of the parser statements,
    parser.add_argument('--resize-out-ratio', type=float, default=4.0,
    help='if provided, resize heatmaps before they are post-processed. default=1.0')
  2. (Optional) I also changed the the waitKey time to what woks for my requirements to this: cv2.waitKey(10) == ord('q'):
  3. Finally, remember to specify the video file name when calling run_video.py file.

After these steps, I got the expected output. The stick figure was showing on top of the human figure in the video.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jax79sg picture jax79sg  路  4Comments

tomercohen11 picture tomercohen11  路  6Comments

vladbelo picture vladbelo  路  4Comments

gavinzhang1995 picture gavinzhang1995  路  6Comments

ssoumyajit picture ssoumyajit  路  3Comments