归一化函数:

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)

最新文章

  1. c# 判断访问来源是否来自手机
  2. 备忘:mybatis 3的使用记录
  3. git stuff
  4. Android驱动入门-Led控制+app+ndk库+底层驱动
  5. Java编程思想学习(十四) 枚举
  6. POJ 1062 昂贵的聘礼 最短路 难度:0
  7. PopuWindow_2
  8. TP复习4
  9. 【WEB】jsp向servlet传参中文乱码问题解决
  10. HDOJ(HDU) 2504 又见GCD(利用最大公约数反推)
  11. css Block formatting context BFC
  12. linux下C/C++,多线程pthread《转载》
  13. 【DG】利用闪回数据库(flashback)修复Failover后的DG环境
  14. maven库
  15. 设计模式系列之装饰模式(Decorator Pattern)
  16. [jQuery]循环遍历改变a标签的href
  17. 微信6.7.4 ios12 软键盘收回时页面不回弹,导致光标位置错乱,再次点击输入框区域时无法focus
  18. Linux环境nginx的配置
  19. 10.19JS日记
  20. python socket编程函数介绍

热门文章

  1. Ubuntu 1804 进入紧急模式
  2. Linux在实际中的应用
  3. 关于SSM中mybatis向oracle添加语句采用序列自增的问题
  4. Sublime Text3 python自动补全问题——Sublime Text3安装Anaconda插件
  5. class(一)--类的创建
  6. Day 16:输入输出字符流、缓冲输入字符流
  7. Mysql: if 结构
  8. java处理浮点数小数点后几位
  9. DuplicateHandle伪句柄与实句柄的应用二
  10. StarUML 3.0.2安装激活