trrahul / densepose-video

Code to run densepose on video with detectron. https://github.com/facebookresearch/Detectron
GNU General Public License v3.0
62 stars 18 forks source link

I can get the image one by one,not the video #12

Closed highway007 closed 5 years ago

highway007 commented 5 years ago

I can find the only image(update per second) in the DensePoseData/infer_out ,but no video here.What's more,at the end there is a error: [image2 @ 0x24ed4e0] Could find no file with path 'DensePoseData/infer_out/vid/file%02d.png' and index in the range 0-4 DensePoseData/infer_out/vid/file%02d.png: No such file or directory

trrahul commented 5 years ago

Can you post the whole terminal output?

highway007 commented 5 years ago

@trrahul Thx my friend! Here it is: _root@18804d89e5cb:/densepose# python2 tools/infer_vid.py --cfg configs/DensePose_ResNet101_FPN_s1x-e2e.yaml --output-dir DensePoseData/infer_out/ --wts https://s3.amazonaws.com/densepose/DensePose_ResNet101_FPN_s1x-e2e.pkl --input-file DensePoseData/001.mp4 Found Detectron ops lib: /usr/local/caffe2_build/lib/libcaffe2_detectron_ops_gpu.so E0219 01:36:56.171475 40 init_intrinsics_check.cc:54] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0219 01:36:56.171490 40 init_intrinsics_check.cc:54] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. E0219 01:36:56.171494 40 init_intrinsics_check.cc:54] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU. WARNING cnn.py: 40: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information. INFO net.py: 51: Loading weights from: /tmp/detectron-download-cache/DensePose_ResNet101_FPN_s1x-e2e.pkl I0219 01:36:56.901773 40 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000123051 secs I0219 01:36:56.901931 40 net_dag.cc:61] Number of parallel execution chains 63 Number of operators = 402 I0219 01:36:56.915855 40 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 0.000106152 secs I0219 01:36:56.916005 40 net_dag.cc:61] Number of parallel execution chains 30 Number of operators = 358 I0219 01:36:56.918161 40 net_dag_utils.cc:118] Operator graph pruning prior to chain compute took: 1.7369e-05 secs I0219 01:36:56.918213 40 net_dag.cc:61] Number of parallel execution chains 10 Number of operators = 30 |Processing Frame 1/632 -Frame read in 0.007s | Inference time: 1.377s | im_detect_bbox: 1.357s | im_detect_body_uv: 0.020s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 2/632 -Frame read in 0.000s |Processing Frame 3/632 -Frame read in 0.000s | Inference time: 0.134s | im_detect_bbox: 0.117s | im_detect_body_uv: 0.017s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 4/632 -Frame read in 0.000s |Processing Frame 5/632 -Frame read in 0.000s | Inference time: 0.131s | im_detect_bbox: 0.113s | im_detect_body_uv: 0.017s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 6/632 -Frame read in 0.000s |Processing Frame 7/632 -Frame read in 0.000s | Inference time: 0.129s | im_detect_bbox: 0.113s | im_detect_body_uv: 0.016s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 8/632 -Frame read in 0.000s |Processing Frame 9/632 -Frame read in 0.000s | Inference time: 0.140s | im_detect_bbox: 0.110s | im_detect_body_uv: 0.030s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 10/632 -Frame read in 0.000s |Processing Frame 11/632 -Frame read in 0.000s | Inference time: 0.127s | im_detect_bbox: 0.107s | im_detect_body_uv: 0.019s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 12/632 -Frame read in 0.000s |Processing Frame 13/632 -Frame read in 0.000s | Inference time: 0.127s | im_detect_bbox: 0.109s | im_detect_body_uv: 0.018s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 14/632 -Frame read in 0.000s |Processing Frame 15/632 -Frame read in 0.000s | Inference time: 0.126s | im_detect_bbox: 0.108s | im_detect_body_uv: 0.018s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 16/632 -Frame read in 0.000s |Processing Frame 17/632 -Frame read in 0.000s | Inference time: 0.126s | im_detect_bbox: 0.107s | im_detect_body_uv: 0.019s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 18/632 -Frame read in 0.000s |Processing Frame 19/632 -Frame read in 0.000s | Inference time: 0.128s | im_detect_bbox: 0.109s | im_detect_body_uv: 0.019s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 20/632 -Frame read in 0.000s |Processing Frame 21/632 -Frame read in 0.000s | Inference time: 0.124s | im_detect_bbox: 0.109s | im_detect_body_uv: 0.015s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 22/632 -Frame read in 0.001s |Processing Frame 23/632 -Frame read in 0.000s | Inference time: 0.125s | im_detect_bbox: 0.107s | im_detect_body_uv: 0.018s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 24/632 -Frame read in 0.000s |Processing Frame 25/632 -Frame read in 0.000s | Inference time: 0.130s | im_detect_bbox: 0.108s | im_detect_body_uv: 0.022s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 26/632 -Frame read in 0.000s |Processing Frame 27/632 -Frame read in 0.000s | Inference time: 0.132s | im_detect_bbox: 0.107s | im_detect_body_uv: 0.025s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 28/632 -Frame read in 0.000s |Processing Frame 29/632 -Frame read in 0.000s | Inference time: 0.136s | im_detect_bbox: 0.108s | im_detect_body_uv: 0.028s | miscbbox: 0.000s ... ... _|Processing Frame 626/632 -Frame read in 0.000s |Processing Frame 627/632 -Frame read in 0.000s | Inference time: 0.136s | im_detect_bbox: 0.108s | im_detect_body_uv: 0.028s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 628/632 -Frame read in 0.000s |Processing Frame 629/632 -Frame read in 0.000s | Inference time: 0.135s | im_detect_bbox: 0.107s | im_detect_body_uv: 0.028s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 630/632 -Frame read in 0.000s |Processing Frame 631/632 -Frame read in 0.000s | Inference time: 0.138s | im_detect_bbox: 0.108s | im_detect_body_uv: 0.031s | misc_bbox: 0.000s IUV written to: DensePoseData/infer_out/out_IUV.png |Processing Frame 632/632 -Frame read in 0.000s ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 [image2 @ 0x18124e0] Could find no file with path 'DensePoseData/infer_out/vid/file%02d.png' and index in the range 0-4 DensePoseData/inferout/vid/file%02d.png: No such file or directory

rept commented 5 years ago

I got the exact same problem. I would expect many png files but only find one (out_IUV) and the ffmpeg command fails. Could this be because the source video isn't in 30 fps? @jaggernaut007 you happen to have any idea, I saw a commit from you in sept that removed frame_no and added the ffmpeg functionality.

rept commented 5 years ago

@highway007 make sure you replace the existing detectron/utils/vis.py file with the one included in this repo. I copied the vis.py into the tools directory, that's not sufficient.

rept commented 5 years ago

Also you'll need to edit infer_vid.py and add

frame_no=frame_no after line kp_thresh=2

shen113 commented 5 years ago

@rept It works!! But after that,i got another problem. vid/out.mp4: No such file or directory Can you give me some suggestions? Thanks!!

rept commented 5 years ago

@shen113 Yeah, look in both the py files you copied, somewhere there is vid/out.mp4 . I just renamed it to /vid/out and make sure the dir existed.

shen113 commented 5 years ago

@rept I solved it~ thank you

highway007 commented 5 years ago

@rept sry ,I jump to another project those days,but this issue seems solved(I doesn't try this).So I will close this. Thx for your help anyway !

EmanueleFeola commented 5 years ago

@rept How can I give densepose a local image input? I ran all the tests that there are on the documentation and it is working, but I don't understand how I can run densepose on an image of my own Thank you in advance