0
print(humans)
for human in humans:
    pose_2d_mpii, visibility = common.MPIIPart.from_coco(human)
    pose_2d_mpiis.append([(int(x * standard_w + 0.5), int(y * standard_h + 0.5)) for x, y in pose_2d_mpii])
    visibilities.append(visibility)
    # This is to account for events where a body part is not detected - affects indexing order #
    # Create list indexing to find the actual index of body parts #
    print(human.body_parts.items())
    for item in human.body_parts.items():
        indexing.append(item[0])

print(indexing)

    

This is the humans output:

[<estimator.Human object at 0x0000024AEBBC4508>, <estimator.Human object at 0x0000024AEBBC4548>, <estimator.Human object at 0x0000024AEBBC45C8>]

This is the human.body_parts.item() output:

dict_items([(1, <estimator.BodyPart object at 0x0000024AE59949F8>), (2, <estimator.BodyPart object at 0x0000024AEAAEFB38>), (5, <estimator.BodyPart object at 0x0000024AE5994A48>), (3, <estimator.BodyPart object at 0x0000024AEAAEF598>), (4, <estimator.BodyPart object at 0x0000024AE5198048>), (6, <estimator.BodyPart object at 0x0000024AEAAEFF98>), (7, <estimator.BodyPart object at 0x0000024AEBBBED68>), (8, <estimator.BodyPart object at 0x0000024AEAAEFAE8>), (11, <estimator.BodyPart object at 0x0000024AEAAEFD68>), (0, <estimator.BodyPart object at 0x0000024AE59944F8>), (14, <estimator.BodyPart object at 0x0000024AE59947C8>), (16, <estimator.BodyPart object at 0x0000024AEAAEF638>), (15, <estimator.BodyPart object at 0x0000024AE5994598>), (17, <estimator.BodyPart object at 0x0000024AEAAEF188>)])
dict_items([(1, <estimator.BodyPart object at 0x0000024AE59948B8>), (2, <estimator.BodyPart object at 0x0000024AEAAEFBD8>), (5, <estimator.BodyPart object at 0x0000024AE5994908>), (3, <estimator.BodyPart object at 0x0000024AEAAEF6D8>), (6, <estimator.BodyPart object at 0x0000024AEAAEF1D8>), (7, <estimator.BodyPart object at 0x0000024AEAAEF688>), (8, <estimator.BodyPart object at 0x0000024AE5994728>), (11, <estimator.BodyPart object at 0x0000024AE5994B88>), (12, <estimator.BodyPart object at 0x0000024AE5994B38>), (0, <estimator.BodyPart object at 0x0000024AE59945E8>), (14, <estimator.BodyPart object at 0x0000024AE5994868>), (16, <estimator.BodyPart object at 0x0000024AEAAEFA48>), (15, <estimator.BodyPart object at 0x0000024AE5994638>), (17, <estimator.BodyPart object at 0x0000024AEAAEF728>)])
dict_items([(1, <estimator.BodyPart object at 0x0000024AE5994A98>), (2, <estimator.BodyPart object at 0x0000024AEAAEFC78>), (5, <estimator.BodyPart object at 0x0000024AE5994BD8>), (3, <estimator.BodyPart object at 0x0000024AEAAEF4F8>), (4, <estimator.BodyPart object at 0x0000024AEAAEF548>), (6, <estimator.BodyPart object at 0x0000024AEAAEFEA8>), (7, <estimator.BodyPart object at 0x0000024AEAAEF818>), (8, <estimator.BodyPart object at 0x0000024AE5994778>), (11, <estimator.BodyPart object at 0x0000024AEAAEFC28>), (0, <estimator.BodyPart object at 0x0000024AEAAEF9A8>), (14, <estimator.BodyPart object at 0x0000024AE59946D8>), (16, <estimator.BodyPart object at 0x0000024AEAAEFE08>), (15, <estimator.BodyPart object at 0x0000024AEAAEF9F8>), (17, <estimator.BodyPart object at 0x0000024AEAAEF228>)])

This is the indexing output:

[1, 2, 5, 3, 4, 6, 7, 8, 11, 0, 14, 16, 15, 17, 1, 2, 5, 3, 6, 7, 8, 11, 12, 0, 14, 16, 15, 17, 1, 2, 5, 3, 4, 6, 7, 8, 11, 0, 14, 16, 15, 17]

The number of items of each Human object is different, due to detection accuracy of tf-pose-estimation. I wish to be able to create a 2D list for each human as the row, with the respective indexes as the column. The code above is what i wrote for single human scenarios. But if i were to use this same code, the list would be a combination of all human indexes for multiple human scenarios. I would appreciate all the help. Thank you!

indexing[0].append(item[0])

From my understanding, this would be the appropriate way to do this? But how would i go about looping this for each human?

0 Answers0