From f98b7804eebf91714c33b2bbbe2cecf52be24d90 Mon Sep 17 00:00:00 2001 From: H_Man <752453098@qq.com> Date: Fri, 8 Nov 2024 01:20:39 +0000 Subject: [PATCH] =?UTF-8?q?update=20deploy/pipeline/ppvehicle/vehicleplate?= =?UTF-8?q?=5Fpostprocess.py.=20=E8=A7=A3=E5=86=B3=E6=8A=A5=E9=94=99:=20At?= =?UTF-8?q?tributeError:=20module=20'numpy'=20has=20no=20attribute=20'int'?= =?UTF-8?q?.=20`np.int`=20was=20a=20deprecated=20alias=20for=20the=20built?= =?UTF-8?q?in=20`int`.=20To=20avoid=20this=20error=20in=20existing=20code,?= =?UTF-8?q?=20use=20`int`=20by=20itself.=20Doing=20this=20will=20not=20mod?= =?UTF-8?q?ify=20any=20behavior=20and=20is=20safe.=20When=20replacing=20`n?= =?UTF-8?q?p.int`,=20you=20may=20wish=20to=20use=20e.g.=20`np.int64`=20or?= =?UTF-8?q?=20`np.int32`=20to=20specify=20the=20precision.=20If=20you=20wi?= =?UTF-8?q?sh=20to=20review=20your=20current=20use,=20check=20the=20releas?= =?UTF-8?q?e=20note=20link=20for=20additional=20information.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: H_Man <752453098@qq.com> --- deploy/pipeline/ppvehicle/vehicleplate_postprocess.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/pipeline/ppvehicle/vehicleplate_postprocess.py b/deploy/pipeline/ppvehicle/vehicleplate_postprocess.py index 66a00a341..d0506bb9f 100644 --- a/deploy/pipeline/ppvehicle/vehicleplate_postprocess.py +++ b/deploy/pipeline/ppvehicle/vehicleplate_postprocess.py @@ -153,10 +153,10 @@ class DBPostProcess(object): ''' h, w = bitmap.shape[:2] box = _box.copy() - xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1) - xmax = np.clip(np.ceil(box[:, 0].max()).astype(np.int), 0, w - 1) - ymin = np.clip(np.floor(box[:, 1].min()).astype(np.int), 0, h - 1) - ymax = np.clip(np.ceil(box[:, 1].max()).astype(np.int), 0, h - 1) + xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int32), 0, w - 1) + xmax = np.clip(np.ceil(box[:, 0].max()).astype(np.int32), 0, w - 1) + ymin = np.clip(np.floor(box[:, 1].min()).astype(np.int32), 0, h - 1) + ymax = np.clip(np.ceil(box[:, 1].max()).astype(np.int32), 0, h - 1) mask = np.zeros((ymax - ymin + 1, xmax - xmin + 1), dtype=np.uint8) box[:, 0] = box[:, 0] - xmin -- Gitee