YuliangXiu/PoseFlow

Errors in building the DeepMatching Library

Closed this issue · 16 comments

Can you please upload a generic version of the makefile or any specific step s to edit the makefile for compiling the deepmatching library?

and please also comment about its compatibility with python 3?

you can refer to deepmatching-issue to figure out how to compile the deepmatching library.

This project is developed by python2, but I think it is not difficult to convert to python3, the implementation does not contain complex functions with wired operations.

Thank you, this helps, I am able to build deepmatching and get correspondences.

While modifying the tracker.py script for my own dataset, I am unable to understand the part mentioned in following lines-

[
 # init tracking info of the first frame in one video
            if idx == 0:
                for pid in range(1, track[video_name][frame_name]['num_boxes']+1):
                        track[video_name][frame_name][pid]['new_pid'] = pid
track[video_name][frame_name][pid]['match_score'] = 0
]

refer here

Only the first frame is assigned a pid?
How is it handled by the stack_all_pids function?

For me, the function throws an error when it loops through consecutive frame idxs. It is unable to find the ['new_pid'] key in frames other than the first one. Any help/debugging insight would be of a great help at this stage.

@YuliangXiu , @yuuuuwwww, @tmanh

Thanks,

@ashar-ali
I think that code is for the copying the poses from the former frame when there is no poses at all in the current frame.

Did you include this part which connects (or tracks) 2 poses between the former frame and the current frame, and this part which adds the person that appears in the first time of a video.
Maybe that's the reason which causes the 'new_pid' key error.

for pid1, pid2 in match_indexes:
    if match_scores[pid1][pid2] > match_thres:
        track[video_name][next_frame_name][pid2+1]['new_pid'] = cur_all_pids[pid1]['new_pid']
        max_pid_id = max(max_pid_id, track[video_name][next_frame_name][pid2+1]['new_pid'])
        track[video_name][next_frame_name][pid2+1]['match_score'] = match_scores[pid1][pid2]

# add the untracked new person
for next_pid in range(1, track[video_name][next_frame_name]['num_boxes'] + 1):
    if 'new_pid' not in track[video_name][next_frame_name][next_pid]:
        max_pid_id += 1
        track[video_name][next_frame_name][next_pid]['new_pid'] = max_pid_id
        track[video_name][next_frame_name][next_pid]['match_score'] = 0

I modified the code for my project here (https://github.com/yuuuuwwww/AlphaPose/blob/master/PoseFlow/pose_tracker.py).
It seems the code is working fine, so I hope it can help you 😄

That's right, I was finally able to get this to work last night, forgot closing the issue.

Thank you very much for the help. 👍

@ashar-ali 请问下您,如何将alphapose得到的.json处理成alpha-pose-results-sample.json相同的格式啊??
还有帧数较长效果怎么样呢?

I borrowed from the original json writer function provided in the Alphapose repository.

I am not able to understand your second question.

@ashar-ali thanks~~i will have a try

@yuuuuwwww hello,Thank you very much for the help.the code at 23 line had a bug, so I modified it to
def read_or_generate_deepmatching_result(frame_id_1, frame_id_2, video_dir, deepmatching_exec_path='./deepmatching'):

but i got errors:
**/bin/sh: 1: ./deepmatching: Permission denied** Exception KeyError: KeyError(<weakref at 0x7f34732042b8; to 'tqdm' at 0x7f34731fdf50>,) in <bound method tqdm.__del__ of 0%| | 0/140 [00:00<?, ?it/s]> ignored Traceback (most recent call last): File "pose_tracker.py", line 178, in <module> main() File "pose_tracker.py", line 133, in main all_cors = read_or_generate_deepmatching_result(frame_id, next_frame_id, args.video_dir) File "pose_tracker.py", line 43, in read_or_generate_deepmatching_result return np.loadtxt(cor_filepath) File "/home/vivian/HelloWorld/helloworld1/lib/python2.7/site-packages/numpy/lib/npyio.py", line 917, in loadtxt fh = np.lib._datasource.open(fname, 'rt', encoding=encoding) File "/home/vivian/HelloWorld/helloworld1/lib/python2.7/site-packages/numpy/lib/_datasource.py", line 260, in open return ds.open(path, mode, encoding=encoding, newline=newline) File "/home/vivian/HelloWorld/helloworld1/lib/python2.7/site-packages/numpy/lib/_datasource.py", line 616, in open raise IOError("%s not found." % path) I**OError: ./posetrack_data/video/deepmatching_result/000000_000001.txt not found**.

@my-hello-world We have already released the ORB version, you can use ORB version without installing DeepMatching lib.

@my-hello-world
If you want to use my code, you need to make a directory named "deepmatching_result" in the same directory as the video file, like:

  • video directory
    • {...}.mp4
    • deepmatching_result
      • {...}_{...}.txt
      • ...

If the text files already exist, the code will use them.
If not, it will generate the text file there by calling deepmatching (you need to build the deepmatching to the specified path which is defined by deepmatching_exec_path).

PoseFlow(General Version) has already been released, now you can do pose tracking on any private dataset, the new version also supports pose tracking results visualization.

Hello, I still got this error with the newest version code, it turns out the program didn't go into the outside for loop:
for idx, frame_name in enumerate(tqdm(frame_list[:-1])):

what does it means if it can't go into that for loop, what should I do to fix it, thanks!

tmanh commented

Could you please show us more details? Like the error message for example. Without any information I don’t think other people could help you.

@tmanh sorry, the original result of the running program is like this:
error

and the conclusion I had drawn above is the result after I debugged the code

tmanh commented

You should check if you could get in to this if and for loop (lines 168 to 171, tracker-general.py). If you can't get into this if and loop, I think there is no detected persons in the scene.

if idx == 0:
    for pid in range(1, track[frame_name]['num_boxes']+1):
        track[frame_name][pid]['new_pid'] = pid
        track[frame_name][pid]['match_score'] = 0