由于吃了屎的原因需要隔一个位置删除图片。。
# coding: utf-8
from PIL import Image, ImageDraw, ImageFont
import os
import shutil
import cv2 as cv
import numpy as np
import json
from time import sleep
#删除侧面图象
def read_json(file_name):
with open(file_name, 'rb') as f:
data = json.load(f)
return data
#将长宽比不对的删除
if __name__ == "__main__":
#my_copy("./1/kuaisu.json","D:\\code\\select\\1\\","D:\\code\\select\\final\\")
for i in range(1000,1453,2):
i = i+1
os.remove("E:\\Datasets\\defect2\\final9.4\\noo"+"\\"+str(i)+".bmp")