blendMask

1、安装Detectron2

按照官方安装步骤进行安装
官方文档
https://github.com/facebookresearch/detectron2/blob/main/INSTALL.md
下载Detectron2相关代码

git clone https://github.com/facebookresearch/detectron2.git   #用git下载代码
python -m pip install -e detectron2                            #安装detectron2

2、安装AdelaiDet

git clone https://github.com/aim-uofa/AdelaiDet.git
cd AdelaiDet
python setup.py build develop
python demo/demo.py \
    --config-file configs/BlendMask/R_101_dcni3_5x.yaml \
    --input datasets/input1.jpg \
    --confidence-threshold 0.35 \
    --opts MODEL.WEIGHTS blendmask_r101_dcni3_5x.pth
python demo/demo.py --config-file configs/BlendMask/R_101_dcni3_5x.yaml --input ./datasets/00000.jpg --confidence-threshold 0.35 --opts MODEL.WEIGHTS ./blendmask_r101_dcni3_5x.pth

3、运行

添加链接描述
添加链接描述

报错

1、 ImportError(“cannot import name ‘string_metric’ from ‘rapidfuzz’

错误原因:rapidfuzz包版本过高
解决办法:降低该包版本为1.1.1版本,直接下载报错,去官网下载相应轮子文件进行安装

pip install rapidfuzz==1.1.1

2、AttributeError: module ‘PIL.Image’ has no attribute ‘LINEAR’

解决办法:卸载Pillow-10.0.0

重新安装Pilow=8.4.0

即降低Pillow版本即可。

3、ImportError: /home/jy/segement/detectron2/detectron2/_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor7reshapeEN3c108ArrayRefIlEE

AdelaiDet训练自己的数据集(COCO格式数据集)

注册数据集

从detectron2/data/datasets中修改builtin.py

# builtin中添加的内容
# 在_PREDEFINED_SPLITS_COCO["coco"]中添加自己数据集的路径
_PREDEFINED_SPLITS_COCO["coco"] = {
   
   
    # 自己的数据集:
    # "coco_handwritten_train"为自定义名称,后面会用到;后面的两个路径第一个是图片目录,第二个是对应json文件路径
    # 训练集
    "coco_handwritten_train": 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值