# Pose estimation: change input from videos to images

**URL:** <https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697>\
**Category:** DeepStream SDK\
**Tags:** opencv, gstreamer\
**Created:** [March 11, 2021, 1:41pm UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697 "2021-03-11T13:41:43Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [March 11, 2021, 1:41pm UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/1 "2021-03-11T13:41:43Z")

</div>

Please provide complete information as applicable to your setup.

**• Hardware Platform (GTX 1660)**  
**• DeepStream Version 5.0**  
**• TensorRT Version 7.0.0.11**  
**• NVIDIA GPU Driver Version 440.33.01**  
**• Issue Type: question**

Hello,

I was trying to test out the pose estimation app ([GitHub - NVIDIA-AI-IOT/deepstream\_pose\_estimation: This is a sample DeepStream application to demonstrate a human pose estimation pipeline.](https://github.com/NVIDIA-AI-IOT/deepstream_pose_estimation)) on a desktop PC running Ubuntu 18.04 but it fails every time because of the h264 parser, it gives the following error  
h264-parser: No valid frames found before end of stream

I tried to use videos encoded with an H264 encoder as well as using videos provided by deepstream sdk with it’s samples, all having the same outcome.

The real problem I am facing is not using the app with video streams as a source, but with images instead. My question is, could any model (densene121 or resnet18) be used with images to output a skeleton or they are made to work only with videos? and if it’s possible, how can i change the pipeline to load images instead of videos?

I tried to replace the h264 parser and nvv4l2-decoder with a jpeg one but the outcome was an out of bounds radius error.

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [March 12, 2021, 7:08am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/3 "2021-03-12T07:08:04Z")

</div>

> [@bogdan.oniga](#):
>
> how can i change the pipeline to load images instead of videos?

What kind of images? JPG files or PNG files?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [March 12, 2021, 7:13am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/4 "2021-03-12T07:13:05Z")

</div>

Deepstream SDK has provided sample codes of JPG file source in deepstream-image-decode-test.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [March 12, 2021, 7:17am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/5 "2021-03-12T07:17:53Z")

</div>

Ok, i’ll check how the sample works. Thank you for the hint.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [March 24, 2021, 2:25pm UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/7 "2021-03-24T14:25:41Z")

</div>

Do you know what can i use to replace the h264 encoder with a jpeg encoder? For some reason if i don’t use an encoder, the app gets stuck in an infinite loop without giving any results nor exit, and if i use the default h264 encoder it fails to run.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [March 25, 2021, 1:39pm UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/8 "2021-03-25T13:39:20Z")

</div>

I changed the original pipeline so i could use images as input. The pipeline i’m currently using is:

```
gst_bin_add_many(GST_BIN(pipeline),
                   streammux, source, jpegparser, decoder, pgie,
                   nvvidconv, nvosd, sink, NULL);

```

but this pipeline is generating another error:

```
Error details: gstnvinfer.cpp(1975): gst_nvinfer_output_loop (): /GstPipeline:deepstream-tensorrt-openpose-pipeline/GstNvInfer:primary-nvinference-engine:
streaming stopped, reason not-negotiated (-4)

```

Also when i checked if the detection worked, the values inside the debugger were showing that it wasn’t the case.  
I used the same image as an input for the sample deepstream-image-decode-test and it had no issues.  
Could anyone please help me figure out what i’m doing wrong?

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [March 26, 2021, 8:34am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/9 "2021-03-26T08:34:19Z")

</div>

I managed to figure out what was causing the streaming error, it was a libEGL problem which was solved by updating the driver, but the problem remains as the model fails to give any relevant output, this time no errors are shown in the console.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [April 6, 2021, 8:57am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/11 "2021-04-06T08:57:54Z")

</div>

> [@bogdan.oniga](#):
>
> the problem remains as the model fails to give any relevant output

How do you know that it is the model who fails?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [April 6, 2021, 9:31am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/13 "2021-04-06T09:31:46Z")

</div>

Is it correct with the original deepstream\_pose\_estimation on your platform?

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [April 6, 2021, 9:37am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/14 "2021-04-06T09:37:46Z")

</div>

I followed the instructions for dGPU platform, i changed the .so files with the ones from the repository, i downloaded the models and converted them using the utility tool from trt\_pose repository, and i changed the source to be the camera feed rather than a h264 video. Also the h264 parser always had an error no matter what video i tried to use, even videos from other samples.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [April 6, 2021, 10:50am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/15 "2021-04-06T10:50:25Z")

</div>

I need to confirm whether the original deepstream\_pose\_estimation can work on your platform.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [April 6, 2021, 11:20am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/16 "2021-04-06T11:20:56Z")

</div>

So there is a possibility that the app can’t work on my system?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [April 7, 2021, 1:00am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/17 "2021-04-07T01:00:21Z")

</div>

The original deepstream\_pose\_estimation has been tested and then released, it should work. If it can not work, there may be configuration or other problem with your platform, we need to fix such problem first.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [April 7, 2021, 6:33am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/18 "2021-04-07T06:33:01Z")

</div>

I used the default config.txt file, i only changed the onnx model, the current config looks like this:

> [property]  
> gpu-id=0  
> net-scale-factor=0.0174292  
> offsets=123.675;116.28;103.53  
> onnx-file=densenet121\_baseline\_att\_256x256\_B\_epoch\_160.onnx  
> labelfile-path=labels.txt  
> batch-size=1  
> process-mode=1  
> model-color-format=0  
> network-mode=2  
> num-detected-classes=4  
> interval=0  
> gie-unique-id=1  
> model-engine-file=densenet121\_baseline\_att\_256x256\_B\_epoch\_160.onnx\_b1\_gpu0\_fp16.engine  
> network-type=100  
> workspace-size=3000  
> output-tensor-meta=true

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [April 7, 2021, 7:47am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/19 "2021-04-07T07:47:47Z")

</div>

Seems the postprocessing output wrong coordinates. You need to check your model, if it is not the same to the sample model in [GitHub - NVIDIA-AI-IOT/deepstream\_pose\_estimation: This is a sample DeepStream application to demonstrate a human pose estimation pipeline.](https://github.com/NVIDIA-AI-IOT/deepstream_pose_estimation), you can not use the postprocessing in the code.

---

<div class="post-metadata">

**Author:** ![bogdan.oniga](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bogdan.oniga](https://forums.developer.nvidia.com/u/bogdan.oniga)\
**Post date:** [April 7, 2021, 8:02am UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/20 "2021-04-07T08:02:05Z")

</div>

Thank you for your help. My mistake was that i used resnet/densenet models without changing anything, and i never tried using the default model. I tried it now and it works.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:14pm UTC](https://forums.developer.nvidia.com/t/pose-estimation-change-input-from-videos-to-images/170697/22 "2021-10-12T16:14:40Z")

</div>

Closed on October 12, 2021, 4:14pm UTC


