2024-07-11
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Nam scuta longa cum ratione respectiva magnae rationis, sicut 1000pix in longitudine, 10pix in latitudine, etc., quaestio de absentis pittaciis in aliquibus imaginibus in notitiis ma- nicis imaginibus aucta in exercitatione erit in imaginibus aucta.
In codice disciplinae, box_candidates functiones in augmentations.py fasciculus in random_perspective ad eliquationem pittacorum imaginum post transmutationem perspectiva, remove cistas nimis parvas (area minor est quam area ante tondendum) et retinent longitudinem ac latitudo cippi
- def box_candidates(box1, box2, wh_thr=2, ar_thr=20, area_thr=0.1, eps=1e-16):
- """box_candidates() is used to filter the labels and reject poor label candidates:
- 用在random_perspective中 对透视变换后的图片label进行筛选
- 去除被裁剪过小的框(面积小于裁剪前的area_thr) 还有长和宽必须大于wh_thr个像素,且长宽比范围在(1/ar_thr, ar_thr)之间的限制
- Compute candidate boxes: box1 before augment, box2 after augment, wh_thr (pixels), aspect_ratio_thr, area_ratio
- :params box1: [4, n]
- :params box2: [4, n]
- :params wh_thr: 筛选条件 宽高阈值
- :params ar_thr: 筛选条件 宽高比、高宽比最大值阈值
- :params area_thr: 筛选条件 面积阈值
- :params eps: 1e-16 接近0的数 防止分母为0
- :return i: 筛选结果 [n] 全是True或False 使用比如: box1[i]即可得到i中所有等于True的矩形框 False的矩形框全部删除
- """
- w1, h1 = box1[2] - box1[0], box1[3] - box1[1] # 求出所有box1矩形框的宽和高 [n] [n]
- w2, h2 = box2[2] - box2[0], box2[3] - box2[1] # 求出所有box2矩形框的宽和高 [n] [n]
- ar = np.maximum(w2 / (h2 eps), h2 / (w2 eps)) # 求出所有box2矩形框的宽高比和高宽比的较大者 [n, 1]
- # 筛选条件: 增强后w、h要大于2 增强后图像与增强前图像面积比值大于area_thr 宽高比大于ar_thr
- return (
-