Skip to content
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

about post-processing #195

Closed
lawo123 opened this issue Jul 31, 2020 · 2 comments
Closed

about post-processing #195

lawo123 opened this issue Jul 31, 2020 · 2 comments

Comments

@lawo123
Copy link

lawo123 commented Jul 31, 2020

if config.TEST.POST_PROCESS:
        for n in range(coords.shape[0]):
            for p in range(coords.shape[1]):
                hm = batch_heatmaps[n][p]
                px = int(math.floor(coords[n][p][0] + 0.5))
                py = int(math.floor(coords[n][p][1] + 0.5))
                if 1 < px < heatmap_width-1 and 1 < py < heatmap_height-1:
                    diff = np.array(
                        [
                            hm[py][px+1] - hm[py][px-1],
                            hm[py+1][px]-hm[py-1][px]
                        ]
                    )
                    coords[n][p] += np.sign(diff) * .25

    preds = coords.copy()

why do this?

@kuldeepbrd1
Copy link

It's a compensation technique to recover quantization error.
HRNet/HRNet-Facial-Landmark-Detection#26 (comment)
Hope it helps

@lawo123
Copy link
Author

lawo123 commented Aug 6, 2020

It's a compensation technique to recover quantization error.
HRNet/HRNet-Facial-Landmark-Detection#26 (comment)
Hope it helps

Thank you very much for your reply, it helped me a lot

@lawo123 lawo123 closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants