当前位置: 首页 > news >正文

detectron2 使用教程

本范例演示使用非常有名的目标检测框架detectron2 🤗🤗

在自己的数据集(balloon数据)上训练实例分割模型MaskRCNN的方法。

detectron2框架的设计有以下一些优点:

  • 1,强大:提供了包括目标检测、实例分割、全景分割等非常广泛的视觉任务模型库。

  • 2,灵活:可以通过注册机制自定义模块或模型结构,从而进行扩展和改进。

  • 3,易用:通过list of dict格式定义自己的数据集, 简单好用。

我们首先需要安装并导入detectron库~

!pip install 'git+https://github.com/facebookresearch/detectron2.git'
!pip install torchkeras 
import numpy as np
import os, json, cv2, random
from PIL import Image import torch import detectron2
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog, DatasetCatalog
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor#from detectron2.utils.logger import setup_logger
#setup_logger()def cv2_show(arr):
    img = Image.fromarray(cv2.cvtCo
http://www.lryc.cn/news/91087.html

相关文章:

  • 哈希表常用数据结构
  • Java字节流
  • arm3399主板-使用ubuntu20.04搭建LVS-DR(netplan)
  • Go中同/异步与锁的应用~~sync包
  • Flask知识点2
  • R语言生物群落(生态)数据统计分析与绘图(从数据整理到分析结果展示)
  • 代码随想录训练营Day58| 739. 每日温度 496.下一个更大元素 I
  • 设计模式-命令模式
  • 软考——下午题部分,例题一,二,三,六
  • 关于render: h => h(App)的解释
  • flask实现简易图书管理系统
  • 2021 年全国大学生物联网设计竞赛(华为杯)全国总决赛获奖名单
  • 操作系统复习2.3.5-管程
  • List Set Map Queue Deque 之间的区别是什么?
  • unity行为决策树实战详解
  • Spring学习记录
  • 模板方法-
  • [Kubernetes] - RabbitMQ学习
  • swagger页面 doc.html出不来,swagger-ui/index.html能出来
  • IEEE802.3和IEEE802.11的分类(仅为分类)
  • c# cad二次开发通过获取excel数据 在CAD绘图,将CAD属性导出到excel
  • LLM之高性能向量检索库
  • 实体类注解
  • 常见数据结构种类
  • linux高级---k8s中的五种控制器
  • 记一次udp服务性能优化经历
  • uniapp和VueI18n多语言H5项目语言国际化功能搭建流程
  • C# | 凸包算法之Jarvis,寻找一组点的边界/轮廓
  • SpringBoot接收请求参数的方式
  • MKS SERVO4257D 闭环步进电机_系列5 CAN指令说明