Fixing some errors.
This commit is contained in:
2136
tests/poses_p1.json
Normal file
2136
tests/poses_p1.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,7 +26,7 @@ def main():
|
||||
print("")
|
||||
|
||||
# Load input data
|
||||
roomparams = [[0, 0, 1], [4, 4, 2]]
|
||||
roomparams = [[0, 0, 1.0], [4.8, 6.0, 2.0]]
|
||||
joint_names = [
|
||||
"nose",
|
||||
"eye_left",
|
||||
@ -57,17 +57,7 @@ def main():
|
||||
pdata = json.load(file)
|
||||
cams = cdata["cameras"]
|
||||
poses_2d = pdata["2D"]
|
||||
cameras = []
|
||||
for cam in cams:
|
||||
camera = spt.Camera()
|
||||
camera.name = cam["name"]
|
||||
camera.K = cam["K"]
|
||||
camera.DC = cam["DC"]
|
||||
camera.R = cam["R"]
|
||||
camera.T = cam["T"]
|
||||
camera.width = cam["width"]
|
||||
camera.height = cam["height"]
|
||||
cameras.append(camera)
|
||||
cameras = spt.convert_cameras(cams)
|
||||
|
||||
# Run triangulation
|
||||
triangulator = spt.Triangulator(min_score=0.95)
|
||||
@ -78,6 +68,27 @@ def main():
|
||||
print("3D time:", time.time() - stime)
|
||||
print(np.array(poses_3d))
|
||||
|
||||
# Load input data
|
||||
roomparams = [[0, -0.5, 1.2], [5.6, 6.4, 2.4]]
|
||||
cpath = "/SimplePoseTriangulation/data/p1/sample.json"
|
||||
ppath = "/SimplePoseTriangulation/tests/poses_p1.json"
|
||||
with open(cpath, "r") as file:
|
||||
cdata = json.load(file)
|
||||
with open(ppath, "r") as file:
|
||||
pdata = json.load(file)
|
||||
cams = cdata["cameras"]
|
||||
poses_2d = pdata["2D"]
|
||||
cameras = spt.convert_cameras(cams)
|
||||
|
||||
# Run triangulation
|
||||
triangulator.reset()
|
||||
stime = time.time()
|
||||
poses_3d = triangulator.triangulate_poses(
|
||||
poses_2d, cameras, roomparams, joint_names
|
||||
)
|
||||
print("3D time:", time.time() - stime)
|
||||
print(np.array(poses_3d))
|
||||
|
||||
|
||||
# ==================================================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user