当前位置:网站首页>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站,有手把手教芒果检测!
边栏推荐
- 俄罗斯AIRI研究院等 | SEMA:利用深度迁移学习进行抗原B细胞构象表征预测
- js工具函数,自己封装一个节流函数
- Cesium graphic annotation circle, square, polygon, ellipse, etc
- Trading system development (IV) - trading counter system
- 【Harmony OS】【ArkUI】ets开发 图形与动画绘制
- 佐喃社区
- ZABBIX installation pit avoidance Guide
- Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
- Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL
- BSC parsing input data of transaction
猜你喜欢

opencv怎么安装?opencv下载安装教程

【Proteus仿真】Arduino UNO按键控制数码管闪烁增/减显示

ZABBIX installation pit avoidance Guide

(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

Development of trading system (V) -- Introduction to Sinovel counter

Redis related-03

Disassembly of Weima prospectus: the electric competition has ended and the intelligent qualifying has just begun

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

95% 程序员都在这里摸鱼……

俄罗斯AIRI研究院等 | SEMA:利用深度迁移学习进行抗原B细胞构象表征预测
随机推荐
【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
OpenSUSE environment PHP connection Oracle
Mstp+vrrp+ospf implements a three-tier architecture
【LeetCode】143. 重排链表
BGP biplane architecture
AI quantitative transaction (II) -- tushare financial data framework
Cesium drag 3D model
小心被偷脸!天天用的人脸识别风险原来这么多?
佐喃社区
Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00005
练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。
Color NFT series representing diversity launched on the sandbox market platform
Development of trading system (VI) -- HFT high frequency trading
长沙“求才”:“下力气”与“出实招”并进,“快发展”和“慢生活”兼得
Jilin University 22 spring March "official document writing" assignment assessment-00029
How to use crawlers to capture bullet screen and comment data of station B?
Jilin University 22 spring March "official document writing" assignment assessment-00084
《Missing Parts》NFT 作品集第 5 系列上线 The Sandbox 市场平台
[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube
SQL, CTE, FLG CASE问题