From 27a35ce8a1ffcb1c4405f1729e23636c1d6e947e Mon Sep 17 00:00:00 2001 From: abhipawar93 <50903530+abhipawar93@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:45:09 +0530 Subject: [PATCH 1/3] Update preprocess.py --- src/face3d/util/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/face3d/util/preprocess.py b/src/face3d/util/preprocess.py index b77a3a40..48823425 100644 --- a/src/face3d/util/preprocess.py +++ b/src/face3d/util/preprocess.py @@ -9,7 +9,6 @@ from skimage import transform as trans import torch import warnings -warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) warnings.filterwarnings("ignore", category=FutureWarning) @@ -98,6 +97,7 @@ def align_img(img, lm, lm3D, mask=None, target_size=224., rescale_factor=102.): # processing the image img_new, lm_new, mask_new = resize_n_crop_img(img, lm, t, s, target_size=target_size, mask=mask) - trans_params = np.array([w0, h0, s, t[0], t[1]]) + #trans_params = np.array([w0, h0, s, t[0], t[1]]) + trans_params = np.array([float(w0), float(h0), float(s), float(t[0]), float(t[1])]) return trans_params, img_new, lm_new, mask_new From 8baea32d62f75b6e68a5e8874b2d114d45906f3c Mon Sep 17 00:00:00 2001 From: abhipawar93 <50903530+abhipawar93@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:46:23 +0530 Subject: [PATCH 2/3] Change preds type to float64 for precision --- src/face3d/util/my_awing_arch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/face3d/util/my_awing_arch.py b/src/face3d/util/my_awing_arch.py index cd565617..647fa111 100644 --- a/src/face3d/util/my_awing_arch.py +++ b/src/face3d/util/my_awing_arch.py @@ -15,7 +15,7 @@ def calculate_points(heatmaps): indexes = np.argmax(heatline, axis=2) preds = np.stack((indexes % W, indexes // W), axis=2) - preds = preds.astype(np.float, copy=False) + preds = preds.astype(np.float64, copy=False) inr = indexes.ravel() From 9e85465282c02832236685c6acd4f51fd152bc79 Mon Sep 17 00:00:00 2001 From: abhipawar93 <50903530+abhipawar93@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:47:05 +0530 Subject: [PATCH 3/3] Update torch2onnx.py --- src/face3d/models/arcface_torch/torch2onnx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/face3d/models/arcface_torch/torch2onnx.py b/src/face3d/models/arcface_torch/torch2onnx.py index fc26ab82..49884a92 100644 --- a/src/face3d/models/arcface_torch/torch2onnx.py +++ b/src/face3d/models/arcface_torch/torch2onnx.py @@ -6,7 +6,7 @@ def convert_onnx(net, path_module, output, opset=11, simplify=False): assert isinstance(net, torch.nn.Module) img = np.random.randint(0, 255, size=(112, 112, 3), dtype=np.int32) - img = img.astype(np.float) + img = img.astype(np.float64) img = (img / 255. - 0.5) / 0.5 # torch style norm img = img.transpose((2, 0, 1)) img = torch.from_numpy(img).unsqueeze(0).float()