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

同时增强多个目标:masks, bounding boxes, keypoints

参考链接:

Simultaneous augmentation of multiple targets: masks, bounding boxes, keypoints - Albumentations Documentation

Albumentations 可以将相同的一组变换应用于  the input image  和 all the targets 传递到transform:masks, bounding boxes, keypoints。

Step 1. 使用指定边界框和关键点格式的参数定义 Compose 

transform = A.Compose(
  [A.RandomCrop(width=330, height=330), A.RandomBrightnessContrast(p=0.2)],
  bbox_params=A.BboxParams(format="coco", label_fields=["bbox_classes"]),
  keypoint_params=A.KeypointParams(format="xy", label_fields=["keypoints_classes"]),
)

Step 2. 从磁盘加载所有必需的数据。

For example, here is an image from the COCO dataset. that has one associated mask, one bounding box with the class label person, and five keypoints that define body parts.

An example image with mask, bounding boxes and keypoints

 Step 3. 传递所有目标进行转换并接收其增强版本¶

transformed = transform(
  image=img,
  mask=mask,
  bboxes=bboxes,
  bbox_classes=bbox_classes,
  keypoints=keypoints,
  keypoints_classes=keypoints_classes,
)
transformed_image = transformed["image"]
transformed_mask = transformed["mask"]
transformed_bboxes = transformed["bboxes"]
transformed_bbox_classes = transformed["bbox_classes"]
transformed_keypoints = transformed["keypoints"]
transformed_keypoints_classes = transformed["keypoints_classes"]

The augmented version of the image and its targets 


http://www.kler.cn/news/161720.html

相关文章:

  • 2-4、DEBUG和源程序区别
  • 根据既定数组创建数组的方法汇总 (第3讲)
  • hive映射es表任务失败,无错误日志一直报Task Transitioned from NEW to SCHEDULED
  • Kafka Connect :构建强大分布式数据集成方案
  • 【计算机网络学习之路】HTTP请求
  • C# Solidworks二次开发:三种获取SW设计结构树的方法-第一讲
  • 计算整数各位数字之和 C语言xdoj29
  • GO设计模式——11、装饰器模式(结构型)
  • uniapp实战 —— 自适配高度的可滚动区域(scroll-view的使用技巧)
  • 【Axure教程】树筛选中继器表格
  • 分布式搜索引擎elasticsearch(二)
  • 图表管理功能(前后端实现增删改查)
  • webpack学习-3.管理输出
  • vue中对pdf文件和路径的处理
  • 采样率越高噪声越大?
  • GO设计模式——13、享元模式(结构型)
  • node.js出现version `GLIBC_2.27‘ not found的解决方案
  • oomall课堂笔记
  • 软考2018下午第六题改编逻辑(状态模式)
  • 【动手学深度学习】(十)PyTorch 神经网络基础+GPU
  • QT Windos平台下打包应用程序
  • CSM2433 一款集成2.4G+125K 和8位RISC 的SOC芯片
  • 临时或永久修改linux-kali虚拟机的主机名和遇见的错误解决方法(保姆级图文)【网络工程】
  • 流量分析1--菜刀666
  • [ES]ElasticSearch强转日期的时区问题
  • 备忘录怎么传到电脑?备忘录手机电脑互传方法
  • echarts图之 底部滚动横轴 缩放图形大小
  • 软件开发安全指南
  • IDEA 保存自动ESLint格式化
  • python 涉及opencv mediapipe知识,眨眼计数 供初学者参考