Some mixed updates.
This commit is contained in:
@ -43,5 +43,5 @@ Fast triangulation of multiple persons from multiple camera views.
|
|||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /RapidPoseTriangulation/swig/ && make all && cd ../tests/ && python3 test_interface.py
|
cd /RapidPoseTriangulation/swig/ && make all && cd ../tests/ && python3 test_interface.py && cd ..
|
||||||
```
|
```
|
||||||
|
|||||||
0
extras/easypose/run_container.sh
Normal file → Executable file
0
extras/easypose/run_container.sh
Normal file → Executable file
@ -1,8 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import numpy as np
|
|
||||||
import easypose as ep
|
import easypose as ep
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,9 @@ import matplotlib
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import tqdm
|
import tqdm
|
||||||
|
|
||||||
|
# import utils_2d_pose
|
||||||
|
import utils_2d_pose_ort as utils_2d_pose
|
||||||
import test_triangulate
|
import test_triangulate
|
||||||
import utils_2d_pose
|
|
||||||
from skelda import evals
|
from skelda import evals
|
||||||
|
|
||||||
sys.path.append("/RapidPoseTriangulation/swig/")
|
sys.path.append("/RapidPoseTriangulation/swig/")
|
||||||
|
|||||||
@ -9,7 +9,8 @@ import cv2
|
|||||||
import matplotlib
|
import matplotlib
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import utils_2d_pose
|
# import utils_2d_pose
|
||||||
|
import utils_2d_pose_ort as utils_2d_pose
|
||||||
from skelda import utils_pose, utils_view
|
from skelda import utils_pose, utils_view
|
||||||
|
|
||||||
sys.path.append("/RapidPoseTriangulation/swig/")
|
sys.path.append("/RapidPoseTriangulation/swig/")
|
||||||
|
|||||||
@ -97,9 +97,7 @@ class BaseModel(ABC):
|
|||||||
ishape = list(self.input_shapes[i])
|
ishape = list(self.input_shapes[i])
|
||||||
if "batch_size" in ishape:
|
if "batch_size" in ishape:
|
||||||
max_batch_size = 10
|
max_batch_size = 10
|
||||||
ishape[0] = np.random.choice(
|
ishape[0] = np.random.choice(list(range(1, max_batch_size + 1)))
|
||||||
list(range(1, max_batch_size + 1))
|
|
||||||
)
|
|
||||||
tensor = np.random.random(ishape)
|
tensor = np.random.random(ishape)
|
||||||
tensor = tensor * 255
|
tensor = tensor * 255
|
||||||
else:
|
else:
|
||||||
@ -498,17 +496,12 @@ def get_2d_pose(model, imgs, num_joints=17):
|
|||||||
new_poses = []
|
new_poses = []
|
||||||
for i in range(len(imgs)):
|
for i in range(len(imgs)):
|
||||||
img = imgs[i]
|
img = imgs[i]
|
||||||
|
|
||||||
poses = []
|
|
||||||
dets = model.predict(img)
|
dets = model.predict(img)
|
||||||
for pose in dets:
|
|
||||||
pose = np.asarray(pose)
|
|
||||||
poses.append(pose)
|
|
||||||
|
|
||||||
if len(poses) == 0:
|
if len(dets) == 0:
|
||||||
poses.append(np.zeros([num_joints, 3]))
|
poses = np.zeros([1, num_joints, 3], dtype=float)
|
||||||
|
else:
|
||||||
poses = np.array(poses)
|
poses = np.asarray(dets, dtype=float)
|
||||||
new_poses.append(poses)
|
new_poses.append(poses)
|
||||||
|
|
||||||
return new_poses
|
return new_poses
|
||||||
|
|||||||
Reference in New Issue
Block a user