当前位置:   article > 正文

HMDB51数据处理之avi视频转化为帧_hmdb51_sta.rar

hmdb51_sta.rar
  1. import os
  2. import numpy as np
  3. import cv2
  4. video_src_src_path = 'data/hmdb_data_demo'
  5. label_name = os.listdir(video_src_src_path)
  6. label_dir = {}
  7. index = 0
  8. for i in label_name:
  9. if i.startswith('.'):
  10. continue
  11. label_dir[i] = index
  12. index += 1
  13. video_src_path = os.path.join(video_src_src_path, i)
  14. video_save_path = os.path.join(video_src_src_path, i) + '_jpg'
  15. if not os.path.exists(video_save_path):
  16. os.mkdir(video_save_path)
  17. videos = os.listdir(video_src_path)
  18. # 过滤出avi文件
  19. videos = filter(lambda x: x.endswith('avi'), videos)
  20. for each_video in videos:
  21. each_video_name, _ = each_video.split('.')
  22. if not os.path.exists(video_save_path + '/' + each_video_name):
  23. os.mkdir(video_save_path + '/' + each_video_name)
  24. each_video_save_full_path = os.path.joi
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/193181
推荐阅读
相关标签
  

闽ICP备14008679号