chinademon 2020-04-15
深度学习时,把有些".JPG"后缀的修改成".jpg"
import os jpgs_dir = "./JPEGImages" for jpg_name in os.listdir(jpgs_dir): portion = os.path.splitext(jpg_name) if portion[1] == ".JPG": new_name = portion[0] + ".jpg" jpg_name = os.path.join(jpgs_dir, jpg_name)#os.rename的参数需要的是路径和文件名,所以这里要加上路径,要不然脚本执行失败。 new_name = os.path.join(jpgs_dir, new_name) print(jpg_name) print(new_name) os.rename(jpg_name, new_name)
try_files $uri $notfound =404;add_header Cache-Control max-age=100;log_not_found off;access_log off;