当前位置: 首页 > news >正文

HAR笔记--kinectis-400数据集下载和简单处理代码

1--完整项目地址

liujf69/Data-Processing/Kinectis_400

2--参考

Kinetics-400数据集简介及下载

3--简单处理代码

import os
import csv
import cv2def split_frame(raw_csv: str, root_video_path: str, root_output_path: str, debug: bool = True):csv_reader = csv.reader(open(raw_csv))for idx, row in enumerate(csv_reader): if (idx == 0):continue # ['label', 'youtube_id', 'time_start', 'time_end', 'split', 'is_cc'] label, youtube_id, time_start, time_end, split, is_cc = rowvideo_name = youtube_id + "_" + time_start.zfill(6) + "_" + time_end.zfill(6) + ".mp4"print("Process ", idx, " ", video_name)video_path = os.path.join(root_video_path, label, video_name)save_path = os.path.join(root_output_path, label, video_name.split(".")[0])if not os.path.exists(save_path):os.makedirs(save_path)cap = cv2.VideoCapture(video_path)frame_idx = 0ret = Truewhile ret:ret, rgb_img = cap.read()  # read each frameif (not ret):breakcv2.imwrite(save_path + '/' + str(frame_idx) + '.jpg', rgb_img)frame_idx = frame_idx + 1if debug: # just process one videobreakif __name__ == "__main__":raw_csv = "./label/train_256.csv"root_video_path = "./raw-part/compress/train_256"root_output_path = "./output"split_frame(raw_csv = raw_csv, root_video_path = root_video_path, root_output_path = root_output_path, debug = True)print("All Done!")


http://www.mrgr.cn/news/42642.html

相关文章:

  • python-求一个整数的质因数/字符串的镜像/加数
  • Mybatis——2.2 SQL的映射
  • 【AIGC】2022-CVPR-利用潜在扩散模型进行高分辨率图像合成
  • 深圳楼市国庆“狂欢”:从“冷清”到“火爆”,谁导演了这场大戏
  • 【计算机体系结构】TLB和Cache
  • 如何通过几个简单步骤创建博客
  • Hadoop之WordCount测试
  • 函数重载
  • Python的多线程与多进程:并发编程基础与实战
  • Kubernetes-Operator篇-02-脚手架熟悉
  • 设计模式-解释器模式
  • 探寻自闭症摘帽之路:充分了解康复关键
  • MySQL 查询优化器
  • python-FILIP/字符串p形编码/数字三角形
  • 02:(寄存器开发)流水灯/按键控制LED
  • 深入挖掘C++中的特性之一 — 继承
  • Java开发每日一课:21世纪最流行的语言,Java为什么这么火?
  • 21款奔驰GLE350升级智能辅助驾驶23P 抬头显示HUD 全景360影像案例
  • Javascript数组研究06_手写实现_shift_slice_some_sort_splice
  • 云原生化 - 工具镜像(简约版)