-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running triangulation #88
Comments
Could you give me more context? Are you running the Demo or your own data? Did you edit your Config.toml file? |
I got pose videos and calib_checkerboard.toml file from another project and I generated the static and pose keypoints of the videos using openpose, I skipped the calibration and executed triangulation directly and I got that error. In the config.toml file i only changed calibration_type to 'calculate' |
If you don't run calibration anymore, it should not make a difference whether you set calibration type to calculate or anything else. |
That's the full message Triangulation of 2D points for S00_P00_T00_StaticTrial, for all frames.
|
Oh really, is there nothing kind of like that? -------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-34186a0c8775> in <module>
3 choice = input('Which list index would you like to pick (0, 1, or 2)? ')
4
----> 5 print(favourite_three_franchises[choice])
TypeError: list indices must be integers or slices, not str |
Turns out I was using a try except that's why the full error was not showing.
|
This is strange, I don't see where you would get a string from this line... print(repr([len(json.load(open(json_fname))['people']) for json_fname in json_tracked_files[0]])) Then exit command prompt and run it again so that I can see the output? |
now the print is causing the error Traceback (most recent call last): |
Okay, thanks, we're going step by step :) Now replace the line you added with: json_fname = json_tracked_files[0][0]
print(repr( json.load(open(json_fname))['people'] )) |
Traceback (most recent call last): TypeError: list indices must be integers or slices, not str |
There must be a problem in your json files. Can you print(json_tracked_files) |
This is what the print shows [['./S00_P00_Participant/S00_P00_T00_StaticTrial/pose/cam_1_json/cam1.0.json', './S00_P00_Participant/S00_P00_T00_StaticTrial/pose/cam_1_json/cam1.1.json', './S00_P00_Participant/S00_P00_T00_StaticTrial/pose/cam_1_json/cam1.2.json', './S00_P00_Participant/S00_P00_T00_StaticTrial/pose/cam_1_json/cam1.3.json', ... ]] And this is the content of one of the files [[[269.99053955078125, 387.82830810546875, 0.8961206674575806], [267.3406066894531, 429.7220458984375, 0.9161862134933472], [235.9087677001953, 432.2477111816406, 0.8875619173049927], [223.00326538085938, 495.0760192871094, 0.8772337436676025], ... ]] Does this seem right ? |
Okay, this is where the problem lies: how did you obtain your json files? They should look like that: { "version":1.3,
"people": [
{
"face_keypoints_2d": [
],
"face_keypoints_3d": [
],
"hand_left_keypoints_2d": [
],
"hand_left_keypoints_3d": [
],
"hand_right_keypoints_2d": [
],
"hand_right_keypoints_3d": [
],
"person_id": [
-1
],
"pose_keypoints_2d": [
530.177,
274.224,
0.935098,
533.18,
268.365,
0.871889,
524.347,
268.33,
0.927471,
0,
0,
0,
497.886,
265.285,
0.84834,
544.978,
306.629,
0.835899,
459.615,
309.575,
0.872913,
553.871,
362.398,
0.874023,
433.285,
365.611,
0.924198,
553.889,
397.82,
0.857626,
486.094,
385.952,
0.906055,
530.168,
433.271,
0.899863,
477.319,
436.043,
0.82925,
553.825,
524.455,
0.928564,
477.352,
527.369,
0.934174,
565.631,
621.387,
0.860776,
462.635,
609.772,
0.826998,
503.745,
294.949,
0.88991,
527.267,
224.125,
0.922588,
580.346,
645.022,
0.827753,
594.997,
639.118,
0.813313,
553.912,
624.559,
0.798435,
474.338,
627.385,
0.696133,
456.737,
624.583,
0.761559,
468.435,
618.6,
0.672332
],
"pose_keypoints_3d": [
]
},
{
"face_keypoints_2d": [
],
"face_keypoints_3d": [
],
"hand_left_keypoints_2d": [
],
"hand_left_keypoints_3d": [
],
"hand_right_keypoints_2d": [
],
"hand_right_keypoints_3d": [
],
"person_id": [
-1
],
"pose_keypoints_2d": [
336.022,
250.714,
0.883262,
339.053,
247.771,
0.924258,
...],
"pose_keypoints_3d": [
]
},
} |
This is my keypoints generation script, I executed this command `# generate json files containing the keypoints of each camera (static and pose)
|
I guess you are using the OpenPose python API? For it to work with Pose2Sim, you need to have json files write as above. Keep me updated if/when you make it work! |
Why do I get this error
Project directory: /home/ubuntu/S00_P00_Participant/S00_P00_T00_StaticTrial An error occurred: list indices must be integers or slices, not str
when running
Pose2Sim.triangulation()
The text was updated successfully, but these errors were encountered: