笔记三:灰度(位深度8)转RGB(位深度24),支持批量

import os
from PIL import Image
from tqdm import tqdm
 
img_path = 'D:/dataset/5/Sea'  # 填入图片所在文件夹的路径
img_Topath = 'D:/dataset/6/Sea'  # 填入图片转换后的文件夹路径
 
for item in tqdm(os.listdir(img_path)):
    arr = item.strip().split('*')
    img_name = arr[0]
    image_path = os.path.join(img_path, img_name)
    img = Image.open(image_path)
    if (img.mode != 'RGB'):
        img = img.convert("RGB")
        img.save(img_Topath +'/'+img_name)

仅个人笔记,原作者在这

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【资源说明】 基于python实现的心电时序多标签分类源码+数据集+操作说明.zip 心电时序多标签分类 ## 数据预处理 - 原始数据 心电序列 data/source_data/hf_round2_train/100001.txt ``` I II V1 V2 V3 V4 V5 V6 12 27 14 54 11 6 20 4 13 27 14 54 11 6 20 4 14 28 14 55 12 7 20 4 15 29 14 55 12 8 20 4 16 30 14 56 13 9 20 4 17 30 14 56 13 9 20 4 19 31 15 57 14 10 21 5 20 31 14 57 14 10 21 5 21 32 14 57 14 10 21 5 22 32 13 57 14 10 21 5 23 32 13 57 14 10 21 5 24 33 12 58 15 11 21 6 24 33 11 58 15 11 21 7 24 33 11 58 15 11 21 7 24 33 10 58 15 11 21 8 24 33 10 58 15 11 21 8 ... ``` ![image](data/0.png) ![image](data/1.png) 异常事件标签 data/source_data/hf_round2_arrythmia.txt ``` QRS低电压 电轴右偏 起搏心律 T波变 电轴左偏 心房颤动 非特异性ST段异常 下壁异常Q波 前间壁R波递增不良 ST段变 一度房室传导阻滞 左束支传导阻滞 右束支传导阻滞 完全性左束支传导阻滞 左前分支传导阻滞 右心房扩大 短PR间期 左心室高电压 窦性心动过缓 早期复极化 窦性心律 融合波 ST-T变 非特异性ST段与T波异常 快心室率 非特异性T波异常 室性早搏 房性早搏 窦性心律不齐 完全性右束支传导阻滞 窦性心动过速 不完全性右束支传导阻滞 顺钟向 逆钟向 ``` - 标签统计筛选 ``` >>> python label_select.py -h usage: label_select.py [-h] [-th THRESHOLD] select label above threshold. optional arguments: -h, --help show this help message and exit -th THRESHOLD, --threshold THRESHOLD Threshold of label select. Default: 0.99 ``` - 数据处理 ``` >>> python data_preprocess.py -h usage: data_preprocess.py [-h] [-t TEST_SIZE] data preprocess of ecg. optional arguments: -h, --help show this help message and exit -t TEST_SIZE, --test TEST_SIZE Test size of data set split. Default: 0.2 ``` ## 训练 ``` >>> python train.py -h usage: train.py [-h] [-b BATCH_SIZE] [-lr LR] [-e EPOCH] train ResNet from ecg data. optional arguments: -h, --help show this help message and exit -b BATCH_SIZE, --batch BATCH_SIZE Batch size of training. Default: 8 -lr LR, --lr LR Lea 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值