conda创建虚拟环境报错 http (2)恢复默认源:conda config --remove-key channels,再重新创建。(1)查看 gesit ~/.condarc。2. 总是http error。1. conda创建虚拟环境。
meanshift import numpy as npfrom sklearn.cluster import MeanShift, estimate_bandwidthdef meanShift(features): ''' ''' features = np.array(features).astype(np.float64) '''本质上就是求平均最远k近邻距离, quantile的值表示进行近邻搜索时候的近邻占样本的比例''' bandwidth = estim..
抠图-仿射变换-贴图 简易代码段 import cv2import numpy as npfrom PIL import Imagefrom PIL import ImageDrawobliq_img = cv2.imread('1.png') #倾斜影像,新的纹理rows,cols,_ = obliq_img.shape# img_texture = cv2.imread('2.png') #原始纹理img_texture = Image.open('3.png')print('img_texture.size:.
python 提取骨架 参考:python 简单图像处理(16) 图像的细化(骨架抽取) - xiatwhu - 博客园图像的细化主要是针对二值图而言所谓骨架,可以理解为图像的中轴,,一个长方形的骨架,是它的长方向上的中轴线,圆的骨架是它的圆心,直线的骨架是它自身,孤立点的骨架也是自身。骨架的获取主要有两种方法:(1)https://www.cnblogs.com/xianglan/archive/2011/01/01/1923779.htmlimport cv2# 输入需要细化的图片(经过二值化处理的图片)和映射矩
Detectron2 Draw Loss Curve import jsonimport refrom pylab import *fig = figure(figsize=(8,6), dpi=300)y1 = fig.add_subplot(111)y1.set_xlabel('Iterations')y2 = y1.twinx()y1.set_ylim(0,1.0)parsed=[]with open('./pointrend_rcnn_r101_FPN_3x/metrics.json') as f: try: .
笔记:Training Schedules mmdetection, detectron2中常见的,例如:mask_rcnn_r101_fpn_1x_coco.pymask_rcnn_r101_fpn_2x_coco.py1x, 2x表示epoch、和lr下降规则的设置。1x 表示:在总batch size为16时,初始学习率为0.02,在6万轮和8万轮后学习率分别下降10倍,最终训练9万轮2x 策略为1x策略的两倍,同时学习率调整位置也为1x的两倍。...
detectron2 测试训练好的模型并画出结果图 import numpy as npimport cv2import osfrom PIL import Image#from matplotlib import pyplotimport matplotlib.pyplot as pltimport random#from google.colab.patches import cv2_imshowimport detectron2from detectron2.utils.logger import setup_loggerset.
python 旋转图像和JSON坐标 # coding:utf-8import cv2import osimport numpy as npimport mathimport copyimport jsondef rotate_about_center(src, angle, scale=1.): w = src.shape[1] h = src.shape[0] rangle = np.deg2rad(angle) #angle in radians nw = (abs(np.sin(ra.
python 最小二乘平面拟合 import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport math# 从txt文档读取点def readTxt(textfile): with open(textfile, 'r') as f: x2, y2, z2 = [], [], [] for line in f.readlines(): li.