当前位置:网站首页>JPEG2jpg
JPEG2jpg
2022-08-04 05:29:00 【CV小Rookie】
import os
import string
dir1 = "11/"
dir2 = "test/"
# 读取函数,用来读取文件夹中的所有函数,输入参数是文件名
def read_directory(directory_name):
i=0
for filename in os.listdir(directory_name):
print(filename)
if "DS_Store" in filename:
continue
newname = filename
newname = newname.split(".")
if newname[-1]=="JPEG":
i=i+1
newname[-1]="jpg"
newname[-2]=str(i)
newname = str.join(".",newname) #这里要用str.join
filename = dir1+filename
newname = dir2+newname
os.rename(filename,newname)
read_directory("./11")
边栏推荐
猜你喜欢

(十五)B-Tree树(B-树)与B+树

CTFshow—Web入门—信息(1-8)

安装dlib踩坑记录,报错:WARNING: pip is configured with locations that require TLS/SSL

AIDL communication between two APPs
![[Deep Learning 21 Days Learning Challenge] 2. Complex sample classification and recognition - convolutional neural network (CNN) clothing image classification](/img/5f/e5db59bdca19b275b2139020ebc6ea.png)
[Deep Learning 21 Days Learning Challenge] 2. Complex sample classification and recognition - convolutional neural network (CNN) clothing image classification

完美解决keyby造成的数据倾斜导致吞吐量降低的问题

TensorFlow2学习笔记:6、过拟合和欠拟合,及其缓解方案

VScode配置PHP环境

TensorFlow2学习笔记:7、优化器

TensorFlow2 study notes: 5. Common activation functions
随机推荐
SQL的性能分析、优化
完美解决keyby造成的数据倾斜导致吞吐量降低的问题
AIDL communication between two APPs
(十)树的基础部分(二)
VScode配置PHP环境
【go语言入门笔记】12、指针
纳米级完全删除MYSQL5.7以及一些吐槽
yolov3中数据读入(一)
flink问题整理
CAS与自旋锁、ABA问题
(十一)树--堆排序
flink-sql所有数据类型
多项式回归(PolynomialFeatures)
TensorFlow2学习笔记:8、tf.keras实现线性回归,Income数据集:受教育年限与收入数据集
MySql--存储引擎以及索引
SQl练习 2022/6/29
SQL练习 2022/7/1
Kubernetes基础入门(完整版)
SQL练习 2022/7/2
Redis持久化方式RDB和AOF详解