Closed zhangguangxun closed 4 years ago
Hi zhangguangxun,
Thank you for visiting my repo.
Yes, you need to convert mp4 video into hdf5 or images (png, jpg).
This is because loading images or hdf5 files is faster than loading mp4 when extracting features and training models.
You can convert mp4 video with utils/generate_video_hdf5.py
or utils/generate_video_jpg.py
.
So please run these codes first.
Thanks.
Thanks a lot for your quick reply
Sorry to interrupt you again. I was confused when I was trying to run generate_video_hdf5.py
.
I found the type of dir_path and dst_path is Path
when I run this
python utils/generate_video_hdf5.py dir_path=./data/MSRVTT/TrainValVideo dst_path=./data/MSRVTT/TrainValVideohdf5/ dataset=msrvtt
The error is that argparse toke dir_path=./data/MSRVTT/TrainValVideo
as the dir_path rather than ./data/MSRVTT/TrainValVideo
If I remove the keyword as
python utils/generate_video_hdf5.py ./data/MSRVTT/TrainValVideo/ ./data/MSRVTT/TrainValVideohdf5/ dataset=msrvtt
The code will run but it seems that nothing had happened. So do you have some suggestions to the above question? Or how can I pass the Path type variable in Shell. Thanks a lot.
The error for the first situation is that
Traceback (most recent call last):
File "utils/generate_video_hdf5.py", line 133, in <module>
class_dir_paths = [x for x in sorted(args.dir_path.iterdir())]
File "/home/zhangguangxun/anaconda3/envs/exp_env/lib/python3.6/pathlib.py", line 1081, in iterdir
for name in self._accessor.listdir(self):
File "/home/zhangguangxun/anaconda3/envs/exp_env/lib/python3.6/pathlib.py", line 387, in wrapped
return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: 'dir_path=./data/MSRVTT/TrainValVideo'
Hi zhangguangxu
I think the second one is correct, but I think all of the keywords should be removed.
You seemed to assign dataset=msrvtt
to args.dataset
.
Please try to run the below
python utils/generate_video_hdf5.py ./data/MSRVTT/TrainValVideo/ ./data/MSRVTT/TrainValVideohdf5/ msrvtt
Thanks~~~
can you please help me with bellow error
Traceback (most recent call last):
File "utils/generate_video_hdf5.py", line 128, in
@hayachiq Thanks for visiting my repo.
To convert mp4 videos to hdf5, you need to install FFmpeg
and FFprobe
.
Please install them and try again.
@yiskw713 thank you for your fast reply ... sadly it didnt work after installing FFmpeg and FFprobe i got the same error.
@hayachiq sorry, i don't know why it doesn't work... My codes support not only hdf5 but also image files such as jpg and png. So please try to convert mp4 videos to jpg images using tools like opencv.
its ok dear thank you for your kind help
hi :) it turns out it needed OS restart for ffmpeg installation worked successfully now thank you
In your link, the dataset MSR-VTT is in mp4 however in your code the formation of videos should be in hdf5. Does it mean I need to change the mp4 video into hdf5 firstly?