赞
踩
- import os
- import numpy as np
- import cv2
-
- video_src_src_path = 'data/hmdb_data_demo'
- label_name = os.listdir(video_src_src_path)
- label_dir = {}
- index = 0
- for i in label_name:
- if i.startswith('.'):
- continue
- label_dir[i] = index
- index += 1
- video_src_path = os.path.join(video_src_src_path, i)
- video_save_path = os.path.join(video_src_src_path, i) + '_jpg'
- if not os.path.exists(video_save_path):
- os.mkdir(video_save_path)
-
- videos = os.listdir(video_src_path)
- # 过滤出avi文件
- videos = filter(lambda x: x.endswith('avi'), videos)
-
- for each_video in videos:
-
- each_video_name, _ = each_video.split('.')
- if not os.path.exists(video_save_path + '/' + each_video_name):
- os.mkdir(video_save_path + '/' + each_video_name)
-
- each_video_save_full_path = os.path.joi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。