project-posenet icon indicating copy to clipboard operation
project-posenet copied to clipboard

Not able to run pose_camera.py on a video

Open pakcodee opened this issue 3 years ago • 3 comments

Description

l am trying to run this following command on the dev board

mendel@silly-llama:~/project-posenet$ python3 pose_camera.py --videosrc BenVid.MOV

The goal is to map out the poses of the people in the video but l am getting this error, does anyone have an idea of what could be missing? l am running headless connecting via mdt shell and downloaded fresh project repo without any changes.

Traceback (most recent call last): File "pose_camera.py", line 166, in main() File "pose_camera.py", line 162, in main run(run_inference, render_overlay) File "pose_camera.py", line 127, in run jpeg=args.jpeg File "/home/mendel/project-posenet/gstreamer.py", line 366, in run_pipeline pipeline.run() File "/home/mendel/project-posenet/gstreamer.py", line 74, in run sinkelement.set_property('sync', False) AttributeError: 'NoneType' object has no attribute 'set_property'

Click to expand!

Issue Type

Bug, Build/Install, Support

Operating System

Mac OS

Coral Device

Dev Board

Other Devices

No response

Programming Language

No response

Relevant Log Output

Traceback (most recent call last):
  File "pose_camera.py", line 166, in <module>
    main()
  File "pose_camera.py", line 162, in main
    run(run_inference, render_overlay)
  File "pose_camera.py", line 127, in run
    jpeg=args.jpeg
  File "/home/mendel/project-posenet/gstreamer.py", line 366, in run_pipeline
    pipeline.run()
  File "/home/mendel/project-posenet/gstreamer.py", line 74, in run
    sinkelement.set_property('sync', False)
AttributeError: 'NoneType' object has no attribute 'set_property'

pakcodee avatar Apr 23 '22 19:04 pakcodee

I'm having the same issue too. I'm trying to just process a video on the devboard, but there are no examples of processing videos in the repo---just processing via cameras.

aiwhoo avatar Apr 23 '22 19:04 aiwhoo

Hello @pakcodee project-posenet repo has not been implemented to accept .mov files. Please try changing this line as below to accept .mov files. Thanks!

    if '.MOV' in videosrc.upper():
        PIPELINE = f'filesrc location={videosrc} ! qtdemux name=demux  demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink   demux.video_0 ! queue '
    else:
        PIPELINE = 'v4l2src device=%s ! {src_caps}' % videosrc

Reference: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-qtdemux.html

sample files: https://filesamples.com/formats/mov

hjonnala avatar Apr 25 '22 19:04 hjonnala

After adding that line of code and running this is what the output is, the same as before but without the errors Gstreamer pipeline: filesrc location=BenVid.MOV ! qtdemux name=demux demux.audio_0 ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink demux.video_0 ! queue ! decodebin ! videoflip video-direction=identity ! tee name=t t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! freezer name=freezer ! rsvgoverlay name=overlay ! videoconvert ! autovideosink t. ! queue max-size-buffers=1 leaky=downstream ! videoconvert ! videoscale ! video/x-raw,width=641,height=480 ! videobox name=box autocrop=true ! video/x-raw,format=RGB,width=641,height=481 ! appsink name=appsink emit-signals=true max-buffers=1 drop=true

pakcodee avatar Apr 28 '22 22:04 pakcodee