Zielon / metrical-tracker

Metrical Monocular Photometric Tracker [ECCV2022]
https://zielon.github.io/mica/
Other
312 stars 22 forks source link

about running tracker.py #35

Open bbakpil opened 5 months ago

bbakpil commented 5 months ago

Hello, thanks for your awesome work.

I'm having trouble on running tracker.py.

def parse_batch(self, batch): images = batch['image'] landmarks = batch['lmk'] landmarks_dense = batch['dense_lmk']

lmk_dense_mask = ~(landmarks_dense.sum(2, keepdim=True) == 0)
lmk_mask = ~(landmarks.sum(2, keepdim=True) == 0)

left_iris = landmarks_dense[:, left_iris_mp, :]
right_iris = landmarks_dense[:, right_iris_mp, :]
mask_left_iris = lmk_dense_mask[:, left_iris_mp, :]
mask_right_iris = lmk_dense_mask[:, right_iris_mp, :]

batch['left_iris'] = left_iris
batch['right_iris'] = right_iris
batch['mask_left_iris'] = mask_left_iris
batch['mask_right_iris'] = mask_right_iris

return images, landmarks, landmarks_dense[:, mediapipe_idx, :2], lmk_dense_mask[:, mediapipe_idx, :], lmk_mask

landmarks_dense.shape = [1, 68, 2], which seems like 68 landmarks. However, left_iris_mp = [468, 469, 470, 471, 472] right_iris_mp = [473, 474, 475, 476, 477] and mediapipe_idx = [276. 282, ... ]

left_iris_mp , right_iris_mp , and mediapipe_idx exceeds the index of landmarks_dense. Am I doing something wrong? Please give me any suggestion if possible.

Thank you in advance.

Zielon commented 5 months ago

Hmm, there is some problem because landmarks_dense.shape = [1, 68, 2] is the wrong size. How did you generate the input?

bbakpil commented 5 months ago

Hello, if my input images are in path_image = ./input/image, I used MICA to generate identity.npy using path_image. Then, I selected one identity.npy and put it into path_image. Next, python tracker.py --cfg ./configs/actors/tmp.yml

bbakpil commented 5 months ago

Does the input have to be a video (.mp4)?

chenzhekl commented 5 months ago

I am having the same question as @bbakpil. We are interested in applying metrical-tracker to a single image.

superhero177 commented 2 months ago

Hello, @bbakpil , Excuse me, I used the same method as you. Have you solved this problem? image