
脚本程序
CVer儿
开源让世界更美好,闭源让人更富裕
展开
-
socket+回调联合使用
操作同一个套接字(Socket),可能会导致数据混乱。注意点:多个线程同时调用。原创 2025-04-15 18:28:05 · 160 阅读 · 0 评论 -
火山引擎deepseek的注册和登录网址
通过链接可拿145元代金券,畅享火山引擎671B DeepSeek R1!原创 2025-02-23 17:56:51 · 246 阅读 · 0 评论 -
nii转为点云数据
【代码】nii转为点云数据。原创 2025-01-11 14:31:14 · 144 阅读 · 0 评论 -
BraTS脑肿瘤数据处理脚本
【代码】BraTS脑肿瘤数据处理脚本。原创 2025-01-03 00:49:23 · 142 阅读 · 0 评论 -
批量对一个文件夹的图片审阅箭头&圆标注和保存
【代码】批量对一个文件夹的图片箭头&圆标注和保存。原创 2024-11-20 16:41:50 · 109 阅读 · 0 评论 -
3D Slicer医学图像全自动AI分割组合拳-MONAIAuto3DSeg扩展
2.1 进入安装目录C:\Users\wangzhenlin\AppData\Local\slicer.org\Slicer 5.7.0-2024-09-21\bin,安装下载好的whl文件,slicer对应的是python3.9版本。3 最后slicer自动安装对应的包。原创 2024-09-24 18:10:07 · 1630 阅读 · 1 评论 -
vscode ssh离线远程连接ubuntu调试
对于问题需要参考下面连接安装python和debugy的插件拓展,并且配置json文件。2 ssh连接上启动服务器的虚拟环境后无法打断点;1 ssh连接上无法启动服务器的虚拟环境;原创 2024-09-10 18:55:38 · 461 阅读 · 0 评论 -
目标检测数据集格式转换coco
在知道了各个数据集格式的基础上做数据集格式的转换就已经是非常简单的任务了,也有很多优秀的开源框架已经帮我们做好了这些事情比如MMDetection中就已经提供好了现成的工具供我们白嫖(bushi),使用了。上述第二步对任意待转换数据集都是一样的,可以抽象为一个函数,输入的是解析好的不同数据集的Box信息等数据。只要理解了不同数据集的标注方法,转换数据集其实就是一个非常简单自然的过程,可以拓展到任意方式标注的数据集上。其主要由两块核心代码构成,一个是VOC的XML文件解析,一个是Json文件生成。转载 2022-09-20 13:31:25 · 3172 阅读 · 1 评论 -
json labelme coco
linklabelme软件标注后是每张图片都有一个.json文件,这与常用标准coco格式不一致,因此需要进行转换,避免忘记特此记录。可直接在此处下载安装对应版本labelme2coco软件,也可找到github版本,cd到相应目录后运行下列命令进行安装二、找出所有数据中属于图片的(也可找到所有属于.json的,避免重复)三、划分训练集和测试集(此处是按照8:2进行划分,也可自行定义划分方式)四、将训练集和测试集数据分开五、json文件合并自此便完成了全部数据转原创 2022-06-12 17:21:25 · 324 阅读 · 1 评论 -
环境问题ubuntu vscode ssh
1. link2.link原创 2022-01-14 18:01:12 · 178 阅读 · 0 评论 -
如何获取最优图像输入大小
# 导入库import pandas as pdimport matplotlib.pyplot as pltfrom PIL import Imagefrom pathlib import Pathimport imagesizeimport numpy as np# 获取图像路径root=r"D:/Test/YOLOv5/data/coco128_fire/images/val2017/"print( Path(root).iterdir())imgs = [img....原创 2022-01-12 15:58:11 · 349 阅读 · 0 评论 -
temp.....................
https://github.com/GesilaA/deepsort_tensorrt1、从零起步实战slam-->https://julyedu.com/course/getDetail/2162、关键点检测实战-->https://julyedu.com/course/getDetail/2623、图神经网络-->http://www.julyedu.com/course/getDetail/307...原创 2021-10-26 10:12:43 · 1091 阅读 · 0 评论 -
MS Terminal在win10下使用
// This file was initially generated by Windows Terminal 1.4.3141.0// It should still be usable in newer versions, but newer versions might have additional// settings, help text, or changes that you will not see unless you clear this file// and let us .原创 2021-09-13 10:23:48 · 504 阅读 · 0 评论 -
cmake学习
常用的三种指令add_library、target_link_libraries和link_directoriessuch asCMAKE_MINIMUM_REQUIRED(VERSION 2.8)PROJECT(segment)set(CMAKE_CXX_FLAGS "-std=c++14 -O1")link_directories(/usr/local/cuda/lib64)# set(OpenCV_DIR "/opt/opencv/lib/cmake/opencv4")原创 2021-09-07 16:54:20 · 137 阅读 · 0 评论 -
pyautogui控制鼠标
import pyautoguiscreenWidth, screenHeight = pyautogui.size() # 屏幕尺寸mouseX, mouseY = pyautogui.position() # 返回当前鼠标位置,注意坐标系统中左上方是(0, 0)pyautogui.PAUSE = 1.5 # 每个函数执行后停顿1.5秒pyautogui.FAILSAFE = True # 鼠标移到左上角会触发FailSafeException,因此快速移动鼠标到左上角也可以停止w..原创 2021-09-02 15:44:38 · 589 阅读 · 0 评论 -
nii 图像读取转换成CT 值,设置窗宽窗位,保存成png 图像
import numpy as npimport os # 遍历文件夹import nibabel as nib # nii格式一般都会用到这个包import imageio # 转换成图像center = -500 //肺部的窗宽窗位width = 1500def nii_to_image(filepath): filenames = os.listdir(filepath) # 读取nii文件夹 for f in filenames: #.原创 2021-06-05 15:19:55 · 1132 阅读 · 0 评论 -
八个数据标注文件操作的奇技淫巧
一:polygon2bbox二:maskImg2json三.保存四边形矩形框bbox标注信息四.保存不规则边框polygon标注信息五:将labelImg标注的xml BBox文件转成json文件六:voc中txt格式的,也转为json格式七:labelme标注的json文件,打印到原图image上八:labelme的json数据转换成coco数据读取所需的json文件前言:在做视觉图像处理中,尤其是AI领域,会经常与标注数据打交道。其中常用的标注软件也就是labelImg转载 2021-05-13 09:32:50 · 2153 阅读 · 1 评论 -
matplotlib可视化使用
import matplotlib.pyplot as plot# fig = plot.figure(figsize=(10,10),facecolor="blue")fig = plot.figure()ax1 = fig.add_subplot(111)# ax1.plot(history.history['accuracy'])# ax1.plot(history.history['val_accuracy'])ax1.set_title('Model Accuracy'...原创 2021-05-10 11:19:12 · 258 阅读 · 0 评论 -
win10的conda环境安装labelimg
pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple/(后面这行是国内的清华镜像源,下载速度才会比较快)pip install pyqt5-tools -i https://pypi.tuna.tsinghua.edu.cn/simple/pip install lxml -i https://pypi.tuna.tsinghua.edu.cn/simple/pip install labelImg -i https://pypi.原创 2021-05-01 19:50:35 · 426 阅读 · 1 评论 -
超声数据处理脚本
运行data.py功能:自动生成三个文件夹,保存对应的img,label,mask;将原来各级目录数据图像统一重命名并重新保存# import os# import numpy as np # from PIL import Image# import cv2# import shutil# # root = os.path.join(os.getcwd(),'E:\LUNA16\subset0')# file1=r"i原创 2021-03-17 13:45:59 · 356 阅读 · 1 评论 -
opencv_python图片转为视频脚本
如下:# import cv2# import os# #图片路径# im_dir = 'negimg'# #输出视频路径# video_dir = '/video/negimg.avi'# #帧率# fps = 30 # #图片数 # #图片尺寸# # img_size = (841,1023)# #fourcc = cv2.cv.CV_FOURCC('M'...原创 2020-04-10 16:38:26 · 403 阅读 · 0 评论 -
yolo数据集python小脚本
list_txt=file_txt.readlines() self.labels=[float(line.strip('\n')) for line in list_txt]# -*- coding:utf8 -*-import numpy as npimport osimport cv2path=r"grdt_slice"paths=os.listdir(path)with open("non_zeros_piexl.txt",'w') as f: f.原创 2021-01-05 23:25:46 · 463 阅读 · 0 评论 -
netron可视化模型
1.netron的github(https://github.com/lutzroeder/Netron)2. 在conda虚拟环境中安装#指定清华源安装pip install netron -i https://pypi.tuna.tsinghua.edu.cn/simple 3 新建运行py文件;import netronmodelPath = "model.pb"netron.start(modelPath)...原创 2020-07-31 00:06:53 · 519 阅读 · 0 评论 -
keras训练和加载自定义的损失函数
多分类语义分割损失函数:#多分类dicedef dice_coef_fun(smooth=0.001): def dice_coef(y_true, y_pred): #求得每个sample的每个类的dice intersection = K.sum(y_true * y_pred, axis=(1,2,3)) union = K.s...原创 2020-04-20 14:25:44 · 2777 阅读 · 4 评论 -
keras单张预测与hdf5模型转化为.pb形式的脚本
单张预测:# 单张预测image = Image.open(r'0_predict.png')test = cv2.resize(np.array(image),(512,512))test = test.astype('float32')test=np.expand_dims(test,0)print(test.shape)# test = np.reshape(test...原创 2019-10-15 21:56:29 · 675 阅读 · 0 评论 -
介绍一种遍历图像的有效方式
import numpy as npimport osfrom pathlib import Pathimage_dir=r"./123"image_suffixes = (".jpeg", ".jpg", ".png", ".bmp")image_paths = [p for p in Path(image_dir).glob("**/*") if p.suffix.lower() in image_suffixes]print(image_paths[0])print(os.path..原创 2020-07-29 10:49:05 · 284 阅读 · 0 评论 -
16位深度图像转8位灰度
img=imread('output.png')img1=im2uint8(img)imwrite(img1,'result.jpg')或者pythonfrom PIL import Imageimport numpy as npimport mathimg=Image.fromarray(np.uint8(img_array/float(math.pow(2,16)-1)*255...原创 2019-08-14 16:46:42 · 18553 阅读 · 7 评论 -
img2video和video2img
# -*- coding: utf-8 -*-import cv2import os#图片路径im_dir =r'.\data\membrane\image'#输出视频路径video_dir = r'123.mp4'#帧率fps = 10 #图片数 num = 300#图片尺寸img_size = (256,256)#fourcc = cv2.cv.CV_FOURCC('M','J','P','G')#opencv2.4fourcc = cv2.VideoWriter_.原创 2020-06-10 17:15:59 · 1385 阅读 · 0 评论 -
对.nii医学格式图像处理脚本
根据自己实际调试即可# -*- coding: utf-8 -*-"""Created on Tue May 5 16:38:28 2020@author: DELL"""import SimpleITK as sitkimport sys,osimport numpy as npimport matplotlib.pyplot as pltIMAGE_PATH = ''IMAGE_FORMAT = '.png'LABEL_PATH = ''LABEL_FORMAT = .原创 2020-06-04 10:10:13 · 489 阅读 · 0 评论 -
python遍历某个文件脚本
1.编写一个程序,能在当前目录以及当前目录的所有子目录下查找文件名包含指定字符串的文件,并打印出绝对路径。https://blog.youkuaiyun.com/lilong117194/article/details/74537595import osclass SearchFile(object): def __init__(self,path='.'): self._path=path self.abspath=os.path.abspath(self...转载 2020-06-03 15:33:44 · 267 阅读 · 0 评论 -
【数据拓展1---augmentor增强】
# https://blog.youkuaiyun.com/jiuliang1916/article/details/79498885# # -*- coding: utf-8 -*-import Augmentorimport globimport osimport cv2import randomtrain_path = r'images'groud_truth_path = r'...原创 2020-04-22 15:19:47 · 574 阅读 · 0 评论 -
数据集增广opencv_python
个人使用的增广流程代码1. 增广import cv2import osimport numpy as npfrom PIL import Image# 图像混合# https://www.jianshu.com/p/9194f43fd68a# https://blog.youkuaiyun.com/weixin_41203075/article/details/104383047#...原创 2020-04-10 10:09:11 · 1248 阅读 · 0 评论 -
lableme json转化为图片常用的脚本
个人记录使用,针对的是16位图像1. 数据集对比度拓展import cv2import osimport numpy as npfrom PIL import Image# 图像混合file1=r"./3dcm_png"file2=r"./2gu_label"files=os.listdir(file1)files2=os.listdir(file2)path3...原创 2020-03-11 18:04:32 · 1131 阅读 · 0 评论