当前位置:网站首页>Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
2022-06-28 11:48:00 【DaYinYi】
import os
import cv2 as cv
image_path = 'G:/LoveDA/JPEGImages1/'
save_path = 'G:/LoveDA/JPEGImages/'
if not os.path.exists(save_path):
os.makedirs(save_path)
image_file = os.listdir(image_path)
for image in image_file:
if image.split('.')[-1] in ['bmp', 'jpg', 'jpeg', 'png', 'JPG', 'PNG']:
str = image.rsplit(".", 1)
output_img_name = str[0] + ".jpg"
src = cv.imread(os.path.join(image_path, image))
newimg = cv.imwrite(save_path + '/' + output_img_name, src)
print('FINISHED')边栏推荐
- 3. seat number
- MySQL installation configuration and solving the problem of forgetting root password when reinstalling MySQL
- 董宇辉,新东方以及凤凰卫视
- Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
- Introduction to GDB
- Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
- 赛尔号抽奖模拟求期望
- day31 js笔记 DOM下 2021.09.26
- 分析list中有无重复数据且重复了几次
- ProCAST finite element casting process simulation software
猜你喜欢

Packaging and publishing application of jetpack compose desktop version

Simulation of the Saier lottery to seek expectation

QML control type: tabbar

day29 js笔记 2021.09.23

如临现场的视觉感染力,NBA决赛直播还能这样看?

网页提示此站点不安全解决方案

Making and using of dynamic library (shared library)

day31 js笔记 DOM下 2021.09.26

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system

JS foundation 8
随机推荐
Unity screenshot function
Day29 JS notes 2021.09.23
On the output representation of bidirectional LSTM in pytoch
Calculate time using calendar
How to distinguish and define DQL, DML, DDL and DCL in SQL
无法重新声明块范围变量
js中的数组方法 2021.09.18
When an entity is converted to JSON, the field with null value is lost
[sciter]:sciter如何使用i18实现桌面应用多语言切换及其利弊
2022 开源软件安全状况报告:超41%的企业对开源安全没有足够的信心
Makefile introduction
近况
Necessary for beginners PR 2021 quick start tutorial, PR green screen matting operation method
Remote login sshd service
mysql-. SQL file phishing Online
Allez, Meta - Cosme, comme prévu, cette chaleur ne durera pas longtemps.
Use logrotate to automatically cut the website logs of the pagoda
Setinterval, setTimeout and requestanimationframe
Cannot redeclare block range variables
Lihongyi, machine learning 7 Conclusion