tensorflow常用函数库
2024-09-07 05:03:11
归一化函数:
def norm_boxes(boxes, shape):
"""Converts boxes from pixel coordinates to normalized coordinates.
boxes: [N, (y1, x1, y2, x2)] in pixel coordinates
shape: [..., (height, width)] in pixels Note: In pixel coordinates (y2, x2) is outside the box. But in normalized
coordinates it's inside the box. Returns:
[N, (y1, x1, y2, x2)] in normalized coordinates
"""
h, w = shape
scale = np.array([h - 1, w - 1, h - 1, w - 1])
shift = np.array([0, 0, 1, 1])
return np.divide((boxes - shift), scale).astype(np.float32)
最新文章
- c# 判断访问来源是否来自手机
- 备忘:mybatis 3的使用记录
- git stuff
- Android驱动入门-Led控制+app+ndk库+底层驱动
- Java编程思想学习(十四) 枚举
- POJ 1062 昂贵的聘礼 最短路 难度:0
- PopuWindow_2
- TP复习4
- 【WEB】jsp向servlet传参中文乱码问题解决
- HDOJ(HDU) 2504 又见GCD(利用最大公约数反推)
- css Block formatting context BFC
- linux下C/C++,多线程pthread《转载》
- 【DG】利用闪回数据库(flashback)修复Failover后的DG环境
- maven库
- 设计模式系列之装饰模式(Decorator Pattern)
- [jQuery]循环遍历改变a标签的href
- 微信6.7.4 ios12 软键盘收回时页面不回弹,导致光标位置错乱,再次点击输入框区域时无法focus
- Linux环境nginx的配置
- 10.19JS日记
- python socket编程函数介绍