faster rcnn 实现via的自动框人-使用detectron2中faster rcnn将图片中的人检测出来,将坐标导入via(VGG Image Annotator)中,实现自动框选出人的区域

文章介绍了如何在AutoDL平台上使用detectron2的fasterrcnn进行图片中的人脸检测,将结果转化为可识别的CSV格式,并说明了如何将检测结果导入Via进行标注。
摘要由CSDN通过智能技术生成

(自学之用)

在文章自定义AVA数据集(二)_退即是进的博客-CSDN博客  中已经将视频以30帧为间隔进行切割,本文通过faster rcnn 将图片中的人框检测出来,最后将检测的结果转化为via可以识别的csv格式。

1  detectron2地址

   地址:mirrors / facebookresearch / detectron2 · GitCode

2 detectron2安装

以下操作都是在AutoDL算力云 | 弹性、好用、省钱。租GPU就上AutoDL 上操作。

我将detectron2安装到/test目录下,所以先进入到此目录:

然后安装:

pip install -U torch torchvision cython
pip install -U 'git+https://github.com/facebookresearch/fvcore.git' 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
git clone https://github.com/facebookresearch/detectron2 detectron2_repo
pip install -e detectron2_repo

3 faster rcnn 安装

进入到test/detectron2_repo/demo目录下,

 输入命令:

python3 demo.py --config-file ../configs/COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml \
  --input ../img/1.jpg \
  --output ../img/1_1.jpg \
  --opts MODEL.WEIGHTS detectron2://COCO-Detection/faster_rcnn_R_50_FPN_3x/137849458/model_final_280758.pkl

 

4 via的安装及使用

 下载地址:via官网

 

5 faster rcnn 算法导出人类候选框为via格式

 5.1  新建python脚本

在目录/detectron2_repo/demo/下新建一个python脚本,名字为:myvia.py

 

 myvia.py 代码如下:

#Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import glob
import multiprocessing as mp
import os
import tim
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值