Use rgb input for both models.

This commit is contained in:
Daniel
2024-12-02 17:28:34 +01:00
parent dc44a71b2c
commit 36781e616b
3 changed files with 155 additions and 161 deletions

View File

@ -8,8 +8,8 @@ base_path = "/RapidPoseTriangulation/extras/mmdeploy/exports/"
pose_model_path = base_path + "rtmpose-m_384x288.onnx"
det_model_path = base_path + "rtmdet-nano_320x320.onnx"
norm_mean = -1 * np.array([103.53, 116.28, 123.675])
norm_std = 1.0 / np.array([57.375, 57.12, 58.395])
norm_mean = -1 * (np.array([0.485, 0.456, 0.406]) * 255)
norm_std = 1.0 / (np.array([0.229, 0.224, 0.225]) * 255)
# ==================================================================================================
@ -24,11 +24,6 @@ def add_steps_to_onnx(model_path):
mean = norm_mean.astype(np.float32)
std = norm_std.astype(np.float32)
use_bgr = bool("rtmpose" in model_path)
if use_bgr:
mean = mean[::-1]
std = std[::-1]
mean = np.reshape(mean, (1, 3, 1, 1)).astype(np.float32)
std = np.reshape(std, (1, 3, 1, 1)).astype(np.float32)