first commit

This commit is contained in:
Semi212 committed 2021-09-15 11:33:58 +08:00
commit 54ccfb11fe
218 files changed
+19525

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
'''
author : Hatcher W
Email: hcwang@semi.ac.cn
use: 将所有的图片存储到一个文件夹中,便于后续筛选
input:两个json文件 用于提供所有的原始图片路径
output:在ALL文件中存储所有的图片
'''
import json
import os
import shutil
def bigdata_copy(desname):
with open("./vedioroot.json", 'r+') as fvedio:
vediolists = json.load(fvedio)
fvedio.close()
flag_detectlast = True
num = 0
for vediolist in vediolists:
image_num = str(num).zfill(7)
source_path = vediolist.replace(".MP4", "").replace(".mp4", "").replace(".MOV", "").replace(".mov", "").replace("/Hatcher/DATA/", "/Hatcher/model/data_MPKFNet/bigdata/resultdata/")
despath = "../data_MPKFNet/bigdata/ALL/"+desname
if not os.path.exists(despath):
os.makedirs(despath)
######finish vedio to image
for image in os.listdir(source_path):
shutil.copy(os.path.join(source_path,image),os.path.join(despath,image_num)+".jpg")
print(os.path.join(source_path,image))
num +=1
image_num = str(num).zfill(7)
if __name__ == "__main__":
bigdata_copy("Hat_Raw_Data")