当前位置:网站首页>yolov5进阶之零环境快速创建及测试
yolov5进阶之零环境快速创建及测试
2022-06-26 08:32:00 【宇称不守恒4.0】
学习完传统图像处理课程后,神经网络是必然选择,曾经还是在tensorflow框架适用 yolov2,现在的v5据说有非常大的飞跃,我们在网站上每一次验证的点击实际上都给对应公司提供大量的精确图片识别的数据。
搭建yolo时主要按以下几个步骤
1 安装anaconda 略,我还安装了pycharm 比较喜欢在pycharm编程。
2 创建环境,首先在一个专门存放各种环境的硬盘空间建立一个文件夹,用来既保存环境,又保存脚本及数据。我在D盘 pycharm工程文件夹下创建的,一会再说如何适用pycharm.
conda create --prefix=D:/PycharmProjects/yoloV5/yoloV5_env python=3.9
上面命令就是在yolov5文件下,创建一个yoloV5_env保存环境,后面的python版本要写上,用conda管理就是这个好处,不用去base调用解释器,以后不管安装什么环境,都要把对应python版本解释器放到环境中。
conda activate D:\PycharmProjects\yoloV5\yoloV5_env
激活这个环境,然后在线安装,非常快
pip install yolov5
安装过程不应该有错误或警告,然后在python环境下import yolov5 和import torch 成功
再测试cuda,没安装不能用显卡加速
torch.cuda.is_available()
False
我电脑是笔记本,用处不太大,这里就不讨论了。
下面把环境放到pycharm管理
打开pycharm

注意选conda 环境, interpreter解释器会自己搜索到还未管理的yoloV5环境py3.9解释器
然后会提示这是已有的存在的环境,然后就可以在pycharm里管理环境和编写程序了
当然还缺少权重文件,pt文件和测试图片自己下载,也可以在github下载的yolo包里找。
import yolov5
model = yolov5.load('yolov5s.pt')
img = 'images/zidane.jpg'
results = model(img, augment=True)
predictions = results.pred[0]
boxes = predictions[:, :4] # x1, x2, y1, y2
scores = predictions[:, 4]
categories = predictions[:, 5]
results.show()
上面程序就可以实现图像识别测试
虽然只是安装了CPU版,但是也适合通常的笔记本适用,而且这个过程是不是非常简单。
边栏推荐
- 51 MCU project design: Based on 51 MCU clock perpetual calendar
- Relation extraction model -- spit model
- leetcode2022年度刷题分类型总结(十二)并查集
- OpenCV Learning notes iii
- Euler function: find the number of numbers less than or equal to N and coprime with n
- Whale conference provides digital upgrade scheme for the event site
- Application of wireless charging receiving chip xs016 coffee mixing cup
- Zlib static library compilation
- Esp8266wifi module tutorial: punctual atom atk-esp8266 for network communication, single chip microcomputer and computer, single chip microcomputer and mobile phone to send data
- pgsql_ UDF01_ jx
猜你喜欢

力扣399【除法求值】【并查集】

Opencv learning notes 3

隐藏式列表菜单以及窗口转换在Selenium 中的应用

Convex optimization of quadruped

Transformers loading Roberta to implement sequence annotation task

2020-10-20

(3) Dynamic digital tube

(1) Turn on the LED

STM32 project design: an e-reader making tutorial based on stm32f4

STM32 porting mpu6050/9250 DMP official library (motion_driver_6.12) modifying and porting DMP simple tutorial
随机推荐
ROS learning notes (6) -- function package encapsulated into Library and called
Object extraction_ nanyangjx
Summary of common instructions for arm assembly
Speckle denoising method for ultrasonic image
Realizing sequence annotation with transformers
关于极客时间 | MySQL实战45讲的部分总结
自动化测试中,三种常用的等待方式,强制式(sleep) 、 隐式 ( implicitly_wait ) 、显式(expected_conditions)
Backward usage
Solution to the encoding problem encountered by the crawler when requesting get/post
Comparison between Apple Wireless charging scheme and 5W wireless charging scheme
Using transformers of hugging face to realize named entity recognition
多台三菱PLC如何实现无线以太网高速通讯?
Recyclerview item gets the current position according to the X and Y coordinates
Design based on STM32 works: multi-functional atmosphere lamp, wireless control ws2812 of mobile app, MCU wireless upgrade program
Performance comparison of unaryexpr's function on matrix elements in eigen Library
nn. Modulelist and nn Sequential
Clion installation + MinGW configuration + opencv installation
Matlab drawing checkerboard (camera calibration)
pgsql_ UDF01_ jx
STM32 project design: smart door lock PCB and source code based on stm32f1 (4 unlocking methods)