Giter VIP home page Giter VIP logo

Comments (19)

innerlee avatar innerlee commented on May 20, 2024

you can also try to extract frames using denseflow, by setting -s=0

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

videos are complex. Different decoder may output different number of frames.

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Sorry didn't read your post carefully. Could you please post the result of ls THAT_VIDEO_FOLDER?

from denseflow.

zugexiaodui avatar zugexiaodui commented on May 20, 2024

Thank you for your reply!

My script:
extract_opticalflow_2.txt

My video folder (ls 01_023):
src_video_folder.txt

Output:
When I set -s=0:
denseflow_s0.txt (The frames are only copied.)
-s=1:
denseflow_s1.txt

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

This is strange. I will check if there is a bug in writing flow filenames

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Could you please turn on verbose option -v when extracting flow, and post the output log?

from denseflow.

zugexiaodui avatar zugexiaodui commented on May 20, 2024

The output log:

(torch17) luyue@gpu-Super-Server:~/workspace/Projects/MMDetSeg_2/OpticalFlow$ python extract_opticalflow_2.py 
"/home/luyue/workspace/Projects/MMDetSeg_2/data/SHTCampus/Train/01_023", frames ≈ 1298
push frames gray, video_flow_idx 0, batch_size 512
push frames gray, video_flow_idx 511, batch_size 512
push frames gray, video_flow_idx 1023, batch_size 275
loaded video "/home/luyue/workspace/Projects/MMDetSeg_2/data/SHTCampus/Train/01_023", 1299 frames
load frames exit.
1 videos (1299 frames, 1298 tvl1 flows) processed, using 28.586s, decoding speed 45.4418fps, flow speed 45.4068fps
Finished!

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

hmm, nothing wrong.

could you pls reduce the number of frames into 600, and check if the remaining 80 are lost?

from denseflow.

zugexiaodui avatar zugexiaodui commented on May 20, 2024

I still got 600 pairs of flow images.
ls video_dir:
src_600_01023.txt
ls flow_dir:
flow_600_01023.txt

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Try to make a list of 2000 frames, and see if it fails on the 3rd batch

from denseflow.

zugexiaodui avatar zugexiaodui commented on May 20, 2024

I find that the frames are not clear so I extract the frames of the raw video again. The old frames are extracted by ffmpeg command. The new frames are extracted by opencv and I set the IMWRITE_JPEG_QUALITY=100. Old frames have been deleted.

I extract optical flow images for the new frames, and it doesn't fails.

"/home/luyue/workspace/Projects/MMDetSeg_2/data/SHTCampus/Train/2000_01023", frames ≈ 2000
push frames gray, video_flow_idx 0, batch_size 512
push frames gray, video_flow_idx 511, batch_size 512
push frames gray, video_flow_idx 1023, batch_size 512
push frames gray, video_flow_idx 1535, batch_size 465
loaded video "/home/luyue/workspace/Projects/MMDetSeg_2/data/SHTCampus/Train/2000_01023", 2001 frames
load frames exit.
1 videos (2001 frames, 2000 tvl1 flows) processed, using 49.935s, decoding speed 40.0721fps, flow speed 40.0521fps

I checked the output dir and got 2000 pairs of flow images.
Then I extracted optical flow for the original 1298 frames video. I got 1298 pairs of flow images. It seems correct... I cannot repeat my 'bug' now.
I don't know why. However, denseflow works. Thanks for your help.

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Actually you can extract frames using denseflow, with the -s=0 option, as mentioned before.

Anyway, good to hear that the problem has gone.

from denseflow.

zugexiaodui avatar zugexiaodui commented on May 20, 2024

I'm sorry for that I misunderstood what you said about -s=0. Thanks again.

from denseflow.

ChuhuaW avatar ChuhuaW commented on May 20, 2024

Hi,
I encounter a very similar issue. I have 11588 jpg frames in my folder, but only got 11263 pairs of flow. Tried extract frames by setting -s=0, and run denseflow again but it didn't help. I have other folders with more than 20000 frames and it works fine with denseflow.

from denseflow.

ChuhuaW avatar ChuhuaW commented on May 20, 2024

denseflow_s1.txt
Please see the log attached. Seems like the last batch was not saved.

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Okay the log says 1 videos (11588 frames, 11587 tvl1 flows) processed

from denseflow.

ChuhuaW avatar ChuhuaW commented on May 20, 2024

Okay the log says 1 videos (11588 frames, 11587 tvl1 flows) processed

Thanks for the reply. I'm attaching the screenshot showing file counts as well. Only 11263 pairs of flow are saved.
image

from denseflow.

innerlee avatar innerlee commented on May 20, 2024

Is it possible to share the video file?

from denseflow.

ChuhuaW avatar ChuhuaW commented on May 20, 2024

Is it possible to share the video file?

Absolutely! I use ffmpeg to extract the frames in 24 fps.
ffmpeg -i test/video_test_0000007.mp4 -r 24 ./0007/%07d.jpg
https://user-images.githubusercontent.com/16619342/151222045-388f03b9-eafa-42de-8edf-d375c4565f38.mp4

from denseflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.