当前位置:网站首页>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站,有手把手教芒果检测!
边栏推荐
- 数学分析_笔记_第3章:极限
- Hello CTP (II) -- Introduction to CTP
- Development of trading system (VI) -- HFT high frequency trading
- Redis related-03
- 1.初识半音阶口琴
- Siddhartha: the book of life can be regurgitated frequently
- 【Harmony OS】【ARK UI】ETS 上下文基本操作
- Configuration source code
- Development of trading system (V) -- Introduction to Sinovel counter
- 2D 照片变身 3D 模型,来看英伟达的 AI 新“魔法”!
猜你喜欢
Deveco studio 3.0 editor configuration tips
BSC parsing input data of transaction
2.吹响半音阶口琴
小心被偷脸!天天用的人脸识别风险原来这么多?
opencv 红色区域在哪里?
How to use crawlers to capture bullet screen and comment data of station B?
Hello CTP (III) - CTP quotation API
程序猿职业发展9项必备软技能
opencv怎么安装?opencv下载安装教程
Intel 13代酷睿首次露出真面目:68MB缓存提升明显
随机推荐
练习:仿真模拟福彩双色球——中500w巨奖到底有多难?跑跑代码就晓得了。
1. first knowledge of chromatic harmonica
Windows 2003 64 bit system PHP running error: 1% is not a valid Win32 Application
【组队学习】SQL编程语言笔记——Task04
《悉达多》:一生之书,可以时常反刍
Interview with Mo Tianlun | ivorysql wangzhibin - ivorysql, an Oracle compatible open source database based on PostgreSQL
文本关键词提取:ansj
opencv 红色区域在哪里?
Work assessment of pharmaceutical polymer materials of Jilin University in March of the 22nd spring -00025
Perfect shuffle problem
Work assessment of Biopharmaceutics of Jilin University in March of the 22nd spring -00005
Cesium graphic annotation circle, square, polygon, ellipse, etc
JS tool function, self encapsulating a throttling function
@RequestBody解决获取参数为null
client-go gin的简单整合十一-Delete
Hello CTP (V) -- CTP position calculation
Jilin University 22 spring March "official document writing" assignment assessment-00034
虽然传统意义上的互联网早已不复存在,但这并不代表互联网早已消失不再
Jilin University 22 spring March "technical economics" assignment assessment-00073
Development of trading system (VIII) -- Construction of low delay network