当前位置:网站首页>openmmlab-环境配置
openmmlab-环境配置
2022-06-25 03:54:00 【lc_dreams】
1.创建虚拟环境,添加jupyter虚拟环境
conda create -n mmo python=3.7
conda activate mmo
conda install ipykernel
conda install nb_conda`
p.s. 也是从这个地方发现之前的文章配的内核有问题,开始用这个方法配ju虚拟环境,还不错没啥问题了!
2.装对应版本的torch,cuda110->pytorch1.7.0
conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch
3.装mmcv
pip install mmcv-full==1.3.17 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
mmcv版本选择:
https://mmcv.readthedocs.io/en/latest/get_started/installation.html
4.装mim
pip install openmim
测试:
!mim install mmdet==2.22.0
!mim search mmdet --model 'mask r-cnn'
!mim download mmdet --config mask_rcnn_r50_fpn_2x_coco --dest .
5.装mmdet
mim install mmdet==2.22.0
测试Demo:
import os
os.environ['CUDA_VISIBLE_DEVICES']='5'
from mmdet.apis import init_detector,inference_detector,show_result_pyplot
config_file = 'mask_rcnn_r50_fpn_2x_coco.py'
check_point_file = 'mask_rcnn_r50_fpn_2x_coco_bbox_mAP-0.392__segm_mAP-0.354_20200505_003907-3e542a40.pth'
model = init_detector(config_file,check_point_file)
print(model)
Demo='demo.jpeg'
result = inference_detector(model,Demo)
show_result_pyplot(model,Demo,result)
显示那张神椅就大功告成了!剩下的就是去搞数据训自己的模型了!
6.装mmocr
mmocr版本选择:
https://mmocr.readthedocs.io/en/latest/install.html
这里选择0.5.0
https://github.com/open-mmlab/mmocr/archive/refs/tags/v0.5.0.zip
直接github下载然后upload离线安装
cd mmocr0.5.0
pip install -r requirements.txt
pip install -v -e .
export PYTHONPATH=$(pwd):$PYTHONPATH
测试Demo:
from mmocr.utils.ocr import MMOCR
ocr = MMOCR()
results = ocr.readtext('demo/demo_text_ocr.jpg', details=True,print_result=True, imshow=False)
Ubuntu暂时还没弄懂怎么在jupyter显示图片展示,可以把imshow改为False,出现text识别就算大功告成!
今天暂时到这里吧,显示图片这个问题搞的opencv 删了又装,结果ocr又识别不了了,又得重装,特此记录,这次整理连写带装花了1个多小时,比第一次装mmd搞了一整个晚上快多了(就是昨天…)
赶紧睡觉去了,配环境搞的人都麻了,淦!2022-06-12 01:22:25
参考:SJTU open-mmlab 公开课B站,有手把手教芒果检测!
边栏推荐
- Hello CTP (I) - basic knowledge of futures
- Cesium drag 3D model
- Solution to the problem that Linux crontab timed operation Oracle does not execute (crontab environment variable problem)
- Crawler grabs the idea of reading on wechat
- opencv是开源的吗?
- 【Harmony OS】【ArkUI】ets开发 图形与动画绘制
- La gamme NFT Color, qui représente la diversité, est en ligne sur la plate - forme du marché Sandbox
- JS tool function, self encapsulating a throttling function
- DAP数据调度功能完善说明
- Preparedstatement principle of preventing SQL injection
猜你喜欢

Changsha's "talent seeking": "making efforts" and "making practical moves" go hand in hand, "rapid development" and "slow life" go hand in hand

DAP数据调度功能完善说明

程序猿职业发展9项必备软技能

Development of trading system (III) - risk control system

Crawler grabs the data of Douban group

Lao Ye's blessing

Exercise: how difficult is it to simulate the blessing lottery two-color ball - China 500W grand prize? Just run the code.

MySQL modifies and deletes tables in batches according to the table prefix

练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。

(ultra detailed onenet TCP protocol access) arduino+esp8266-01s accesses the Internet of things platform, uploads real-time collected data /tcp transparent transmission (and how to obtain and write Lu
随机推荐
Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL
Development of trading system (III) - risk control system
Work assessment of pharmaceutical polymer materials of Jilin University in March of the 22nd spring -00025
Development of trading system (XI) -- Introduction to quickfix
Perfect shuffle problem
Mobile mall project operation
numpy np tips: numpy数组的squeeze等处理
List rendering in wechat applet
SQL, CTE, FLG CASE问题
严重的PHP缺陷可导致QNAP NAS 设备遭RCE攻击
js工具函数,自己封装一个节流函数
《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台
[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube
(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写
2022-06-21-flink-49 (I. SQL manual)
长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得
【Harmony OS】【ARK UI】ETS 上下文基本操作
Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
Time management understood after working at home | community essay solicitation
Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00031