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

用word可以做网站吗米拓建站

用word可以做网站吗,米拓建站,公众号开发者,网站说明怎么写1. LetterBox增强 当输入图片的尺寸和模型实际接收的尺寸可能不一致时,通常需要使用LetterBox增强技术。具体步骤是先将图片按比例缩放,将较长的边缩放到设定的尺寸以后,再将较短的边进行填充,最终短边的长度为stride的倍数即可。…

1. LetterBox增强

当输入图片的尺寸和模型实际接收的尺寸可能不一致时,通常需要使用LetterBox增强技术。具体步骤是先将图片按比例缩放,将较长的边缩放到设定的尺寸以后,再将较短的边进行填充,最终短边的长度为stride的倍数即可。这种方法可以保留原始图像的纵横比,同时还可以使图像更加适合目标检测算法的输入。
在YOLOv8代码中,ultralytics/data/augment.pyclass LetterBox类别实现了该功能。

import cv2
import numpy as npclass LetterBox:"""Resize image and padding for detection, instance segmentation, pose."""def __init__(self, new_shape=(640, 640), auto=False, scaleFill=False, scaleup=True, center=True, stride=32):"""Initialize LetterBox object with specific parameters."""self.new_shape = new_shapeself.auto = autoself.scaleFill = scaleFillself.scaleup = scaleupself.stride = strideself.center = center  # Put the image in the middle or top-leftdef __call__(self, labels=None, image=None):"""Return updated labels and image with added border."""if labels is None:labels = {}img = labels.get("img") if image is None else imageshape = img.shape[:2]  # current shape [height, width]new_shape = labels.pop("rect_shape", self.new_shape)if isinstance(new_shape, int):new_shape = (new_shape, new_shape)# Scale ratio (new / old)r = min(new_shape[0] / shape[0], new_shape[1] / shape[1])if not self.scaleup:  # only scale down, do not scale up (for better val mAP)r = min(r, 1.0)# Compute paddingratio = r, r  # width, height ratiosnew_unpad = int(round(shape[1] * r)), int(round(shape[0] * r))dw, dh = new_shape[1] - new_unpad[0], new_shape[0] - new_unpad[1]  # wh paddingif self.auto:  # minimum rectangledw, dh = np.mod(dw, self.stride), np.mod(dh, self.stride)  # wh paddingelif self.scaleFill:  # stretchdw, dh = 0.0, 0.0new_unpad = (new_shape[1], new_shape[0])ratio = new_shape[1] / shape[1], new_shape[0] / shape[0]  # width, height ratiosif self.center:dw /= 2  # divide padding into 2 sidesdh /= 2if shape[::-1] != new_unpad:  # resizeimg = cv2.resize(img, new_unpad, interpolation=cv2.INTER_LINEAR)top, bottom = int(round(dh - 0.1)) if self.center else 0, int(round(dh + 0.1))left, right = int(round(dw - 0.1)) if self.center else 0, int(round(dw + 0.1))img = cv2.copyMakeBorder(img, top, bottom, left, right, cv2.BORDER_CONSTANT, value=(114, 114, 114))  # add borderif labels.get("ratio_pad"):labels["ratio_pad"] = (labels["ratio_pad"], (left, top))  # for evaluationif len(labels):labels = self._update_labels(labels, ratio, dw, dh)labels["img"] = imglabels["resized_shape"] = new_shapereturn labelselse:return imgnew_shape=(640, 640)
aug = LetterBox(new_shape,center=True)labels=None
img = cv2.imread("./2.png",-1)lettered_img = aug(labels,img)cv2.imshow('v8 letter_box',lettered_img)
cv2.waitKey(0)

center=True
在这里插入图片描述

center=False
在这里插入图片描述

2 Mosaic增强

3 Mixup增强

http://www.shuangfujiaoyu.com/news/1884.html

相关文章:

  • 国内优秀网站赏析谷歌浏览器入口
  • 建设中的网站备案期间做什网站制作公司怎么样
  • 做网站一般都用什么字体优化师是一份怎样的工作
  • 网页传奇游戏排行站长工具seo排名查询
  • 肇庆网站优化建设平台优化是指什么
  • 做网站公司关键词百度网址链接是多少
  • 网站密码怎么做网站seo分析报告案例
  • 郑州建设安全管理协会网站seo常用的优化工具
  • 网站建设公司电话咨询工厂管理培训课程
  • 网站建设 视频收录是什么意思
  • 专业网站设计公司哪里有网页设计用什么软件
  • 作业页面设计模板广安seo外包
  • 小美客服系统百度优化软件
  • 网站优化提升排名宣传网站怎么做
  • 怎么可以自己做网站seo技术大师
  • 网站加载优化查询关键词网站
  • c2c电子商务网站建设栏目结构图上海最新新闻热点事件
  • 平顶山做网站多少钱营销比较成功的品牌
  • 个人简历模板下载word格式seo网络排名优化哪家好
  • 承德做网站免费b站软件下载
  • 青岛网站seo收费标准怀化seo推广
  • 网站建设安全协议怎么推广一个网站
  • 南阳教育网站平台亚马逊seo关键词优化软件
  • 自助建站系统厂家seo推广视频隐迅推专业
  • 生鲜网站制作五行seo博客
  • 苹果cms网站广告怎么做泰州seo排名扣费
  • 大良网站制作百度代理服务器
  • 江门网站自助建站合肥seo网络营销推广
  • 杭州外贸网站建设公司价格百度一下官方网页版
  • 台州有哪些做网站的公司自己建网站