随笔分类 -  Python

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
Python zone
摘要:pyqt时间格式化 from PyQt5.QtCore import QDateTime currentDateTime = QDateTime.currentDateTime() print(currentDateTime.toString("yyyy-MM-dd hh:mm:ss")) #### 阅读全文
posted @ 2023-03-29 14:42 西北逍遥 阅读(92) 评论(0) 推荐(0)
摘要:python opencv canny import cv2 # Load the image img = cv2.imread('path/to/image.jpg') # Convert the image to grayscale gray = cv2.cvtColor(img, cv2.CO 阅读全文
posted @ 2023-03-28 16:09 西北逍遥 阅读(18) 评论(0) 推荐(0)
摘要:OpenCV提供了多种方法来提取图像中的区域。其中,最常用的方法是使用cv2.rectangle函数绘制矩形框,然后使用切片操作提取矩形框内的像素。 import cv2 # 读取图片 img = cv2.imread('path/to/image') # 绘制矩形框 x, y, w, h = 10 阅读全文
posted @ 2023-03-27 20:01 西北逍遥 阅读(1286) 评论(0) 推荐(0)
摘要:python绘制wav音频文件波形图 #-*- coding: utf-8 -*- import wave import pylab as pl import numpy as np print('working') #打开wav文档 file = wave.open(r"02.wav", "rb" 阅读全文
posted @ 2023-03-26 20:51 西北逍遥 阅读(518) 评论(0) 推荐(0)
摘要:pip install gtts (wind_2021) J:\test>pip install gtts Collecting gtts Downloading gTTS-2.3.1-py3-none-any.whl (28 kB) Collecting requests<3,>=2.27 Usi 阅读全文
posted @ 2023-03-25 20:01 西北逍遥 阅读(71) 评论(0) 推荐(0)
摘要:OpenCV提供了两种计算图像相似度的方法:结构相似性(SSIM)和均方误差(MSE)。其中,SSIM是一种更加准确的方法,它不仅考虑了像素之间的差异,还考虑了人眼对图像的感知。而MSE则只是简单地计算像素之间的差异。 import cv2 # 读取图片 img1 = cv2.imread('pat 阅读全文
posted @ 2023-03-24 16:29 西北逍遥 阅读(2918) 评论(0) 推荐(0)
摘要:python清空cmd命令行 import os os.system('cls') ################### 阅读全文
posted @ 2023-03-23 21:58 西北逍遥 阅读(65) 评论(0) 推荐(0)
摘要:def convert(size, box): dw = 1. / (size[0]) dh = 1. / (size[1]) x = (box[0] + box[1]) / 2.0 - 1 y = (box[2] + box[3]) / 2.0 - 1 w = box[1] - box[0] h 阅读全文
posted @ 2023-03-22 14:33 西北逍遥 阅读(91) 评论(0) 推荐(0)
摘要:# for inference class LoadImages: def __init__(self, path, img_size=640): p = str(Path(path)) # os-agnostic p = os.path.abspath(p) # absolute path if 阅读全文
posted @ 2023-03-20 22:06 西北逍遥 阅读(48) 评论(0) 推荐(0)
摘要:绘制点数据 import os import matplotlib.pyplot as plt import cv2 import math def loadTxtData(uwb_data_file): list_x = [] list_y = [] #txtFile = open("2.txt" 阅读全文
posted @ 2023-03-17 20:21 西北逍遥 阅读(32) 评论(0) 推荐(0)
摘要:训练yolov5 模型 (wind_2021) H:\PytorchProject\yolov5_train_xiaotian_2023031401> (wind_2021) H:\PytorchProject\yolov5_train_xiaotian_2023031401>python trai 阅读全文
posted @ 2023-03-15 07:35 西北逍遥 阅读(59) 评论(0) 推荐(0)
摘要:dict1 = {} dict2={"id":12,"x":23} dict1[str(1)] = dict2 print(dict1) print(dict1[str(1)]) ############## 阅读全文
posted @ 2023-03-14 21:11 西北逍遥 阅读(14) 评论(0) 推荐(0)
摘要:python 全排列 import itertools # 利用itertools库中的permutations函数,给定一个排列,输出他的全排列 def all_permutation_fun(permutation): # itertools.permutations返回的只是一个对象,需要将其 阅读全文
posted @ 2023-03-13 17:04 西北逍遥 阅读(103) 评论(0) 推荐(0)
摘要:绘制矩形框 def plot_one_box_PIL4(box,img, fontSize1,color=None, label=None, line_thickness=None): img = Image.fromarray(img) draw = ImageDraw.Draw(img) #li 阅读全文
posted @ 2023-03-12 20:20 西北逍遥 阅读(181) 评论(0) 推荐(0)
摘要:alphapose win10运行日志 (base) H:\PytorchProject\AlphaPose-master> (base) H:\PytorchProject\AlphaPose-master> (base) H:\PytorchProject\AlphaPose-master>co 阅读全文
posted @ 2023-03-06 21:22 西北逍遥 阅读(512) 评论(0) 推荐(0)
摘要:(wind_2021) H:\PytorchProject\AlphaPose-master> (wind_2021) H:\PytorchProject\AlphaPose-master> (wind_2021) H:\PytorchProject\AlphaPose-master>python 阅读全文
posted @ 2023-03-02 13:55 西北逍遥 阅读(127) 评论(0) 推荐(0)
摘要:import redis r = redis.StrictRedis(host='localhost', port=6379, db=0) r.set('test1', 'test1') value1 = r.get('car') print(value1) all_keys = r.keys() 阅读全文
posted @ 2023-02-27 22:01 西北逍遥 阅读(23) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*- import cv2 import numpy as np import sys #origin_img_path = "J:\\Select_pic\\20230203\\1001123756063.jpg" origin_img_path = "J: 阅读全文
posted @ 2023-02-26 15:10 西北逍遥 阅读(68) 评论(0) 推荐(0)
摘要:python sin arcsin import numpy as np a1 = np.arcsin(0.1226152519) print(a1) b1 = a1*180.0/3.1415926 print(b1) c1 = 2.06*np.sin(7.0) print(c1) ######## 阅读全文
posted @ 2023-02-04 16:45 西北逍遥 阅读(56) 评论(0) 推荐(0)
摘要:pyqt5绘制坐标系 def paintEvent(self, event): painter = QPainter() painter.begin(self) # 绘制图像 image = self.pix if image.width()>0: rect = QRect(0, 0, image. 阅读全文
posted @ 2022-11-24 20:23 西北逍遥 阅读(229) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页