We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The SHHQ-1.0 dataset has a size of 512 x 1024. However, some keypoints have x-values that exceed 512. For example,
For example,
image_000023.jpg 595 150 517 211 478 211 417 345 473 456 550 211 -1 -1 -1 -1 512 467 478 467 461 695 434 918 545 467 500 695 478 896 578 133 601 133 528 122 -1 -1 556 940 556 929 473 912 500 957 478 962 417 934
... These keypoints produce the following results.
( in 18-keypoint visualization)
I inspected the merged_25pts_ldmk.txt file using the following code.
merged_25pts_ldmk.txt
ldmk_path = osp.join(self.root_dir, "merged_25pts_ldmk.txt") with open(ldmk_path, "r") as f: lines = f.readlines() error_hits = 0 for line in lines: line = line.strip().split(" ") key = line[0] keypoints = np.array(line[1:], dtype=np.float32).reshape(-1, 2) # if x is larger than 512, increase error hits if np.any(keypoints[:, 0] > 512): error_hits += 1 print(error_hits)
After conducting the inspection using the above code, it was found that there are a total of 1917 keypoints with such errors.
To address this issue, upon further investigation, it was discovered that the keypoints were based on a 1024 x 1024 reference.
As a solution, subtracting 256 from the x-values yielded the following results.
if np.any(keypoints[:, 0] > 512): keypoints -= np.array([256,0])
I attatched code for fix bug in merged_25pts_ldmk.txt. just run the code through txt file.
import os.path as osp import numpy as np ldmk_path = osp.join("merged_25pts_ldmk.txt") with open(ldmk_path, "r") as f: lines = f.readlines() new_lines = [] for line in lines: line = line.strip().split(" ") key = line[0] keypoints = np.array(line[1:], dtype=np.int8).reshape(-1, 2) # if x is larger than 512, increase error hits if np.any(keypoints[:, 0] > 512): keypoints -= np.array([256, 0]) new_line = ' '.join([key] + [str(i) for i in keypoints.reshape(-1)]) new_lines.append(new_line) with open("new_merged_18pts_ldmk.txt", "w") as f: f.write("\n".join(new_lines))
The text was updated successfully, but these errors were encountered:
fix error.
import os.path as osp import numpy as np ldmk_path = osp.join("merged_25pts_ldmk.txt") with open(ldmk_path, "r") as f: lines = f.readlines() new_lines = [] for line in lines: line = line.strip().split(" ") key = line[0] keypoints = np.array(line[1:], dtype=np.float32).reshape(-1, 2) # if x is larger than 512, increase error hits if np.any(keypoints[:, 0] > 512): missing_keypoint_index = keypoints == -1 keypoints -= np.array([256, 0]) keypoints[missing_keypoint_index] = -1 new_line = " ".join([key] + [str(int(i)) for i in keypoints.reshape(-1)]) new_lines.append(new_line) with open("new_merged_25pts_ldmk.txt", "w") as f: f.write("\n".join(new_lines))
Sorry, something went wrong.
No branches or pull requests
The SHHQ-1.0 dataset has a size of 512 x 1024.
However, some keypoints have x-values that exceed 512.
For example,
For example,
... These keypoints produce the following results.
( in 18-keypoint visualization)
I inspected the
merged_25pts_ldmk.txt
file using the following code.After conducting the inspection using the above code, it was found that there are a total of 1917 keypoints with such errors.
To address this issue, upon further investigation, it was discovered that the keypoints were based on a 1024 x 1024 reference.
As a solution, subtracting 256 from the x-values yielded the following results.
I attatched code for fix bug in
merged_25pts_ldmk.txt
.just run the code through txt file.
The text was updated successfully, but these errors were encountered: