批量删除网上数据集中的预测图片
import os
def del_predict_files(test_path):
for root, dirs, files in os.walk(test_path):
print("test")
for name in files:
if name.endswith("predict.png"):
os.remove(os.path.join(root, name))
print("Delete file:" + os.path.join(root,name))
path = 'data/membrane/test/'
del_predict_files(path)