![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
itsverycool
这个作者很懒,什么都没留下…
展开
-
跨进程修改Numpy数据 基于multiprocessing.shared_memory
multiprocessing.shared_memory Python3.8新特性官方文档import numpy as npfrom multiprocessing import shared_memoryfrom multiprocessing import Processfrom multiprocessing.managers import SharedMemoryManagerdef change(name): a = np.array([0, 0, 0, 0, 0, 0原创 2021-04-14 15:05:43 · 1702 阅读 · 1 评论 -
pip install ray 失败解决办法
首先安装pytest-runnerpip install pytest-runner然后再安装ray即可环境:Windows10 Anaconda Python3.7.9原创 2021-01-03 00:01:11 · 3896 阅读 · 0 评论 -
Python 实现OpenCV DNN人脸检测
import cv2modelFile = "./model/res10_300x300_ssd_iter_140000_fp16.caffemodel"configFile = "./model/deploy.prototxt"faceDetect = cv2.dnn_DetectionModel(modelFile, configFile)if __name__ == "__main__": cap = cv2.VideoCapture(1) cap.set(3, 1920)原创 2020-12-16 19:01:18 · 518 阅读 · 0 评论 -
Numpy sctypeNA and typeNA will be removed in 1.18
The type dictionaries numpy.core.typeNA and numpy.core.sctypeNA are deprecated. They were buggy and not documented and will be removed in the 1.18 release. Usenumpy.sctypeDict instead.原创 2020-11-26 00:12:00 · 263 阅读 · 0 评论 -
numpy.frombuffer+cv2.imdecode读取内存中的图像
nparr = np.frombuffer(image, np.uint8) img_decode = cv2.imdecode(nparr, 1)DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead原创 2020-11-26 00:05:56 · 2053 阅读 · 0 评论 -
用类编写Tkinter实例的正确姿势
代码来自Tkinter官方文档import tkinter as tkclass Application(tk.Frame): def __init__(self, master=None): super().__init__(master) self.master = master self.pack() self.create_widgets() def create_widgets(self): s转载 2020-08-13 16:00:40 · 3150 阅读 · 1 评论 -
在Tkinter中实时更新摄像头画面的正确姿势
def cv2VideoON(self): ''' 摄像头初始化 ''' cap=cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) while True: ret_flag, color_frame = cap.read() BGR_image = cv2.cvtColor(color_image, cv2.COLOR_RGB2BGR) tk_image = Image.fromar..原创 2020-08-13 15:53:51 · 1513 阅读 · 0 评论