Run py files in batches

import os 

""" 
    In the directory where py files need to be executed in batches, enter the name of the executable file and run this file. 
""" 

image_file = "./input" 
# file_ = ["0331","0332","0333 ","0334"] 
image_list=os.listdir(image_file) 
for i in image_list: 
    image_path=os.path.join(image_file,i) 
    os.system("python predict.py --image_path "+str(image_path)+ " --model_path ./model/model.pdparams" 
     +" --config E:\A_paddle\PaddleSeg\configs\segformer\segformer_b5_cityscapes_1024x1024_160k.yml") 
    print(str(i) + ".jpg finished" + "\n \n")

Guess you like

Origin blog.csdn.net/qq_46644680/article/details/130754506