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

@ -158,7 +158,7 @@ class RTMDet(BaseModel):
image, self.dx, self.dy, self.scale = self.letterbox(
image, (tw, th), fill_value=114
)
tensor = np.asarray(image).astype(self.input_type, copy=False)[..., ::-1]
tensor = np.asarray(image).astype(self.input_type, copy=False)
tensor = np.expand_dims(tensor, axis=0)
return tensor
@ -363,7 +363,6 @@ def get_2d_pose(model, imgs, num_joints=17):
new_poses = []
for i in range(len(imgs)):
img = imgs[i]
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
poses = []
dets = model.predict(img)