码迷,mamicode.com
首页 > 其他好文 > 详细

zipfile 实验

时间:2019-10-29 15:43:28      阅读:104      评论:0      收藏:0      [点我收藏+]

标签:对比   iam   yam   dirname   ping   ant   option   icm   ace   

import os
import  glob
from typing import Optional
import cv2
import numpy as np
import torch
import yaml
import zipfile
zip_path=r"./bmp_test_cmp2.zip"
img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/denoising/DnCNN-tensorflow/BK_DeblurGANv2/Finger_test/*/auth/*/*/bmp/*.bmp‘
img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/auth/*/*/bmp/*.bmp‘
img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/enroll/*/*/bmp_test_cmp/*.bmp‘
img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/*/*/*/bmp_test/*.bmp‘   
img_pattern1=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/*/*/*/bmp_test/*.bmp‘  
#img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/*/*/*/bmp/*.bmp‘
#img_pattern=r"/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190814_xiamiCMOS_低温/*/*/*/bmp/*.bmp"
#img_pattern=r"/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190814_xiaomiCMOS_0.1airgap遮黑与不遮黑FRR对比/*/*/*/*/bmp/*.bmp"
#img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/0.2airgap遮黑自校准/auth/*/*/bmp/*.bmp‘
#img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/denoising/DnCNN-tensorflow/BK_DeblurGANv2/bmp_mix_want/bmp/*.bmp‘
#img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/*/*/*/bmp/*.bmp‘
img_pattern2=r"/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190814_xiamiCMOS_低温/*/*/*/bmp_test/*.bmp"
img_pattern3=r"/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190814_xiaomiCMOS_0.1airgap遮黑与不遮黑FRR对比/*/*/*/*/bmp_test/*.bmp"
img_pattern4=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/*/*/*/*/*/bmp_test/*.bmp‘ 
#img_pattern=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger/image/20190813_xiaomiCMOS1.9.2-0812_小米用例(洗手)/0.2airgap遮黑自校准/auth/*/*/bmp_test/*.bmp‘
img_pattern1=r‘/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/1029Finger_part2/image1/*/*/*/*/bmp_test/*.bmp‘  
# imgs1 = glob.glob(img_pattern1)
# imgs2 = glob.glob(img_pattern2)
# imgs3 = glob.glob(img_pattern3)
# imgs4 = glob.glob(img_pattern4)
# imgs=imgs1+imgs2+imgs3+imgs4
imgs=glob.glob(img_pattern1)
myZip = zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED)
for name in imgs:
    basedirname=name.replace("/media/nv/7174c323-375e-4334-b15e-019bd2c8af08/Finger/","")
    print(basedirname)
    myZip.write(name, basedirname, zipfile.ZIP_DEFLATED)
myZip.close()

zipfile 实验

标签:对比   iam   yam   dirname   ping   ant   option   icm   ace   

原文地址:https://www.cnblogs.com/skydaddy/p/11758891.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!