- import numpy as np a=[[1,2,3,4],[1,2,3,4]] a=np.asarray(a) print(a) shape是2,4,先行后列 a=np.zeros((2,2,2,2)) a[:,:,0,0]=([[ import numpy as np a=[[1,2,3,4],[1,2,3,4]] a=np.asarray(a) print(a) shape是2,4,先行后列 a=np.zeros((2,2,2,2)) a[:,:,0,0]=([[
- 日期转时间: from sqlalchemy import Column, Integer, String, Float, Date date = Column(Date) data="20180921" day_his.date = datetime.strptime(date, "%Y%m%d") py... 日期转时间: from sqlalchemy import Column, Integer, String, Float, Date date = Column(Date) data="20180921" day_his.date = datetime.strptime(date, "%Y%m%d") py...
- #include "opencv2/opencv.hpp" #define __STDC_CONSTANT_MACROS using namespace cv; MYLIBDLL int testimg(int data, int length); int testimg(int data, int lengt... #include "opencv2/opencv.hpp" #define __STDC_CONSTANT_MACROS using namespace cv; MYLIBDLL int testimg(int data, int length); int testimg(int data, int lengt...
- plt.axis('equal')# 调整显示的横纵轴比例 这句不要,图示显示是变形的,纵横比例失调。 import matplotlib.pyplot as pltimport numpy as np rotAngle = np.pi/6# 旋转角度shiftX = 1 # x 轴平移量shiftY = 2 # y 轴平移量 t = np.arange(... plt.axis('equal')# 调整显示的横纵轴比例 这句不要,图示显示是变形的,纵横比例失调。 import matplotlib.pyplot as pltimport numpy as np rotAngle = np.pi/6# 旋转角度shiftX = 1 # x 轴平移量shiftY = 2 # y 轴平移量 t = np.arange(...
- 本文列举三种缩放方法: 1.宽或者高固定,等比例缩放 2.缩放系数缩放,比如1.5倍,0.8倍缩放 3.缩放到制定大小,可能失去图像原有比例。 利用Python OpenCV中的 cv.Resize(源,目标,变换方法)就可以实现变换为想要的尺寸了 源文件:就不用说了 目标:你可以对图像进行倍数的放大和缩小 也可以... 本文列举三种缩放方法: 1.宽或者高固定,等比例缩放 2.缩放系数缩放,比如1.5倍,0.8倍缩放 3.缩放到制定大小,可能失去图像原有比例。 利用Python OpenCV中的 cv.Resize(源,目标,变换方法)就可以实现变换为想要的尺寸了 源文件:就不用说了 目标:你可以对图像进行倍数的放大和缩小 也可以...
- 1. os.path.getsize(file_path):file_path为文件路径 import osos.path.getsize('d:/svn/bin/SciLexer.dll')#1479904 2. 遍历文件夹,将所有文件大小加和, os.walk()遍历文件夹 import osfrom os.path imp... 1. os.path.getsize(file_path):file_path为文件路径 import osos.path.getsize('d:/svn/bin/SciLexer.dll')#1479904 2. 遍历文件夹,将所有文件大小加和, os.walk()遍历文件夹 import osfrom os.path imp...
- #!/usr/bin/env python3 #-*- coding:utf-8 -*- import os #导入 os os.chdir("F:/XXXX/") #" "中的路径设置为共享文件夹的路径,代码中的是例子 os.system('python -m http.server 8080')#端口自己设置,不要与其他进程发生冲突 概述 有时候... #!/usr/bin/env python3 #-*- coding:utf-8 -*- import os #导入 os os.chdir("F:/XXXX/") #" "中的路径设置为共享文件夹的路径,代码中的是例子 os.system('python -m http.server 8080')#端口自己设置,不要与其他进程发生冲突 概述 有时候...
- 代码没有亲测,tensorrt感觉是linux的 Onnx To Tensorrt 在安装tensorrt时,会下载一些官方示例,以tensorrt6为例,在samples/python/introductoryparsersamples中,有名为onnx_resnet50.py的文件,此文件是将resnet50.onnx转为tensorrt模型的示例代码,接下来以这个文... 代码没有亲测,tensorrt感觉是linux的 Onnx To Tensorrt 在安装tensorrt时,会下载一些官方示例,以tensorrt6为例,在samples/python/introductoryparsersamples中,有名为onnx_resnet50.py的文件,此文件是将resnet50.onnx转为tensorrt模型的示例代码,接下来以这个文...
- 方法1:ok的 a = [1, 2, 3, 4, 5, 6, 7, 8] # print(id(a)) # print(id(a[:])) for i in a[:]: if i > 5: a.remove(i) print(a) # print(id(a)) 2.filter 内建函数filter()官方文档参考:https:/... 方法1:ok的 a = [1, 2, 3, 4, 5, 6, 7, 8] # print(id(a)) # print(id(a[:])) for i in a[:]: if i > 5: a.remove(i) print(a) # print(id(a)) 2.filter 内建函数filter()官方文档参考:https:/...
- # -*- coding: utf-8 -*-import osimport time import numpy as npimport cv2 #coding=utf-8import numpy as npimport cv2import os from utils.data_augment_1114 import rotate_3 class Point... # -*- coding: utf-8 -*-import osimport time import numpy as npimport cv2 #coding=utf-8import numpy as npimport cv2import os from utils.data_augment_1114 import rotate_3 class Point...
- 一、【问题】 目前有一字符串s = "['a', 'b'],['c', 'd']",想把它分开成为两个列表: list1 = ['a', 'b']list2 = ['c', 'd'] 之后使用itertools.product()求笛卡尔积,应该写成: for i in itertools.product(list1, list2): pri... 一、【问题】 目前有一字符串s = "['a', 'b'],['c', 'd']",想把它分开成为两个列表: list1 = ['a', 'b']list2 = ['c', 'd'] 之后使用itertools.product()求笛卡尔积,应该写成: for i in itertools.product(list1, list2): pri...
- import cv2 if __name__ == "__main__": webcam = cv2.VideoCapture(0) if not webcam.isOpened(): print("can't open the camera!!!") # cv2.namedWindow("video", 0) # cv2.resizeWindow("vid... import cv2 if __name__ == "__main__": webcam = cv2.VideoCapture(0) if not webcam.isOpened(): print("can't open the camera!!!") # cv2.namedWindow("video", 0) # cv2.resizeWindow("vid...
- import turtle as t t.fd(150)#前进150t.left(90)#箭头转90度,与水平垂直,然后画扇形t.circle(150,45)# # t.goto(0,150)# t.fd(150)t.goto(0, 0) for i in range(3): t.right(45) t.fd(150) t.left(90) t.circl... import turtle as t t.fd(150)#前进150t.left(90)#箭头转90度,与水平垂直,然后画扇形t.circle(150,45)# # t.goto(0,150)# t.fd(150)t.goto(0, 0) for i in range(3): t.right(45) t.fd(150) t.left(90) t.circl...
- # coding: cp936 import win32guiimport win32conimport time class TestTaskbarIcon: def __init__(self): # 注册一个窗口类 wc = win32gui.WNDCLASS() hinst = wc.hInstance = win32gui.GetModuleHa... # coding: cp936 import win32guiimport win32conimport time class TestTaskbarIcon: def __init__(self): # 注册一个窗口类 wc = win32gui.WNDCLASS() hinst = wc.hInstance = win32gui.GetModuleHa...
- #-*-coding:utf-8-*- import os import time import cv2 import shutil def is_blur(image,THRESHOLD = 65): is_Var=False start=time.time() gr... #-*-coding:utf-8-*- import os import time import cv2 import shutil def is_blur(image,THRESHOLD = 65): is_Var=False start=time.time() gr...
上滑加载中
推荐直播
-
华为云码道Agent集成与鸿蒙实战2026/08/11 周二 19:00-21:00
王一男-华为云码道产品规划专家;李炎-华为云码道产品专家;彭江敏-华为云鸿蒙端云一体化开发专家
本次直播带你解读华为云码道7月份产品新特性、新功能。更有专家演示码道Agent Space × 钉钉机器集成实战,从0到1打通消息通道;码道鸿蒙端云一体化实战,快速搭建员工签到系统。
回顾中 -
华为云开发者AI素养直播课·第五期2026/09/04 周五 16:00-18:00
林华鼎-华为云AI开发者运营负责人;蒋春阳-华为云AI开发者案例开发专家
本期直播内容: AI工具体验营 · 第5-8课连讲。Agent-Team 多智能体协作完成毕业设计实践
回顾中 -
华为云开发者AI素养ClassRoom·第六期2026/09/08 周二 19:00-20:00
樊渊-2026华为软件挑战赛冠军
高手来了:看软挑高手解析二维排样问题—从工业难题到算法突破
回顾中
热门标签