- 博客(122)
- 资源 (3)
- 收藏
- 关注
原创 Ubuntu16.04 python matplotlib 坐标轴标签出现中文乱码
【代码】Ubuntu16.04 python matplotlib 输出轴标签出现中文乱码。
2023-10-27 17:54:10
380
原创 Python 文件名按时间顺序排序
https://blog.youkuaiyun.com/jacke121/article/details/124762028https://www.likecs.com/show-308200078.html
2023-07-14 14:19:41
511
原创 cudnn环境报错:Wrong cudnn version: 7, Compiled version: 8
旧服务器环境更新,升级CUDA和CUDNN之后,一直无法链接到新的CUDNN地址,配置环境变量也没有用。在新创建的虚拟环境里配置,抛弃旧的虚拟环境。
2023-06-28 16:59:15
240
原创 no module named ‘quad_mesh_simplify‘
no module named 'quad_mesh_simplify'
2022-08-25 19:38:49
913
3
原创 Python Hausdorff distance 豪斯多夫距离
github官方库https://github.com/deepmind/surface-distance代码示例import osimport numpy as npimport codecsimport SimpleITK as sitkimport pandas as pdimport torchimport surface_distance as surfdistdef readlines(file): """ read lines by removing .
2022-05-19 09:32:52
2340
转载 Python numpy tensor相互转换
https://blog.youkuaiyun.com/AugustMe/article/details/113841470
2022-05-19 09:18:27
695
转载 Python 修改字体颜色
https://blog.youkuaiyun.com/ddd53269/article/details/105487984
2022-04-26 10:20:33
6088
原创 Python 删减pkl内容
import osimport pickleimport numpy as npdef read_pickle(work_path): ''' todo: read pkl to list ''' data_list = [] with open(work_path, "rb") as f: while True: try: data = pickle.load(f
2022-04-22 10:26:39
3726
2
原创 Python 随机划分训练和验证集 保存成pkl
import osimport pickleimport numpy as npdef get_train_val_list(work_path): ''' todo: get train val list ''' image_list = [] mask_list = [] case_list = os.listdir(work_path) case_list.sort() for case in case_list:
2022-04-22 10:18:05
615
原创 Python 读取pkl文件
import osimport pickledef read_pickle(work_path): data_list = [] with open(work_path, "rb") as f: while True: try: data = pickle.load(f) data_list.append(data)
2022-04-22 10:07:43
6255
原创 Python numpy 单通道转三通道理解
image = np.expand_dims(a, axis=2)image = np.concatenate((image, image, image), axis=-1)任务一:单通道图像转三通道理解/任务二:按axis=0或axis=1或axis=2(轴)堆叠(stack)
2022-04-08 09:14:57
6237
转载 ubuntu vscode KeyError: ‘LD_LIBRARY_PATH‘
Linux | 一招解决 KeyError: ‘LD_LIBRARY_PATH‘ 错误
2022-04-08 09:04:05
599
原创 Python 两个list合并成一个dict & 写csv &plt绘制直方图
#1 合并成字典case_list = [a,b,c]mean_list = [1,2,3]result = dict(zip(case_name, mean_list))# zip 把两个list合成一个元组,dict()封成字典#2 保存成csvcolumns_name = ['case', 'mean'] info_record = pd.DataFrame(columns = columns_name, data = zip(case_list ,mean_list))
2022-04-07 19:54:14
1003
转载 QObject::moveToThread: Current thread (0x5651ebdaa180) is not the object’s thread (0x5651eba7e2a0).
安装pip install opencv-python==4.1.2.30reference 添加链接描述
2022-04-06 10:07:47
212
原创 Python 将mask盖在图片上
def addAnnotation(image_frame,label_frame,i,save_path): img1 = cv2.imread(img1_path) img2 = cv2.imread(img2_path) alpha = 0.7 beta = 1 - alpha gamma = 0 img_add = cv2.addWeighted(image_frame, alpha, label_frame, beta, gamma, dtype =
2022-04-01 14:39:03
6189
2
原创 Python 根据csv内容复制指定文件到另一文件夹
import osimport csvimport shutildef read_csv(csv_file_path): ''' csv_file_path: csv file absolute path todo: get csv content ''' with open(csv_file_path, 'r') as fp: reader = csv.DictReader(fp) reader.fiel
2022-03-14 20:05:20
1893
原创 Python pydicom imageio 将dcm存成jpg格式
import osimport pydicomimport imageioimport argparseimport numpy as npdef dcm2jpg(dcm_dir_path, save_dir_path): ''' dir_path: where dir 'str' todo: dcm file to jpg format ''' if not os.path.exists(save_dir_path): os
2022-03-14 20:00:03
1409
2
原创 Python list去重
# for exampleraw_list = [0,0,0,2,6,9,8,7,2,4,5,5,6,9]duplicate_removal_list = list(set(raw_list))print(duplicate_removal_list)[0, 2, 4, 5, 6, 7, 8, 9]# 结果自动排序
2022-02-18 14:29:11
527
原创 Pytorch dataset类
自己数据的dataset类,传入数据比如训练数据格式为.txt格式,字符串类型如下所示:/home/xx/data/volume_01.nii.gz /home/xx/data/label_01.nii.gz /home/xx/data/volume_02.nii.gz /home/xx/data/label_02.nii.gz /home/xx/data/volume_03.nii.gz /home/xx/data/label_03.nii.gz /home/xx/data/volume_04.
2022-01-27 15:16:32
3016
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人