open-mmlab / denseflow

Extracting optical flow and frames
https://open-mmlab.github.io/
MIT License
300 stars 61 forks source link

The last batch seems to be dropped when extracting flows. #78

Open DgntYang opened 10 months ago

DgntYang commented 10 months ago

NOTE: I have searched related issues but cannot get the expected help. I have carefully read docs in this repo.

Hi, there. I've encountered a problem when trying to extracting flows using denseflow. My bash code is shown below:

denseflow /home/yangtan/HDD2/dataset/IKEA_ASM/ANU_ikea_dataset_video_480p/Lack_Side_Table/0012_oak_table_02_01_2019_08_16_11_20/dev3/images/scan_video.avi -o=/home/yangtan/HDD2/dataset/IKEA_ASM/ANU_ikea_dataset_video_480p/Lack_Side_Table/0012_oak_table_02_01_2019_08_16_11_20/dev3/flows -b=20 -a=tvl1 -s=1 -v

and the output in terminal is as following:

"/home/yangtan/HDD2/dataset/IKEA_ASM/ANU_ikea_dataset_video_480p/Lack_Side_Table/0012_oak_table_02_01_2019_08_16_11_20/dev3/images/scan_video.avi", frames ≈ 2420
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 512
frames_gray_queue full, waiting...
push frames gray, video_flow_idx 2047, batch_size 372
loaded video "/home/yangtan/HDD2/dataset/IKEA_ASM/ANU_ikea_dataset_video_480p/Lack_Side_Table/0012_oak_table_02_01_2019_08_16_11_20/dev3/images/scan_video.avi", 2420 frames
load frames exit.
1 videos (2420 frames, 2419 tvl1 flows) processed, using 20.238s, decoding speed 119.577fps, flow speed 119.528fps

This video was processed before the flows' extraction. It was 1920x1080 with 25fps at first and was adapted to 720x480 with 16fps later using ffmpeg. The problem is that there are only 2047x2 flow files (flow_[x/y]_00000.jpg ~ flow_[x/y]_02046].jpg)in my output directory. It seems that the last batch whose batch_size is 372 has been dropped. Do you have any possible ideas to get this problem solved?

ddamddi commented 7 months ago

Did you solve this issue ??

DgntYang commented 6 months ago

Did you solve this issue ??

Hi, actually I didn't solve it. However, I found that maintaining the original resolution of the video (extracted frames) can alleviate this problem to some extent.