question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In lib/utils/transforms.py line 179, 180

        center_new[0] = center_new[0] * 1.0 / sf
        center_new[1] = center_new[1] * 1.0 / sf

It should be

        center_new[1] = center_new[1] * new_ht / ht
        center_new[0] = center_new[0] * new_wd / wd

Or the landmark will be shifted.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

2reactions
zongjuedecommented, Jun 6, 2020

Hi, Jim, @ChiHangChen Thanks for your valuable issue. It seems that you are expert in heat map encoding and decoding from the issue. Could you please help me explain some code ? I have tried my best to understand it, but failed.

  1. Could you please tell me the purpose of operation “-1” in the row new_pt = np.array([pt[0] - 1, pt[1] - 1, 1.]).T ? `def transform_pixel(pt, center, scale, output_size, invert=0, rot=0): t = get_transform(center, scale, output_size, rot=rot) if invert: t = np.linalg.inv(t) new_pt = np.array([pt[0] - 1, pt[1] - 1, 1.]).T new_pt = np.dot(t, new_pt) return new_pt[:2].astype(int) + 1

    `

  2. Could you please tell me the purpose of operation “+1” in the row preds[:, :, 0] = (preds[:, :, 0] - 1) % scores.size(3) + 1 and preds[:, :, 1] = torch.floor((preds[:, :, 1] - 1) / scores.size(3)) + 1 ? I think the highest respond point misses if plus 1 on its coordinate. `def get_preds(scores): “”" get predictions from score maps in torch Tensor return type: torch.LongTensor “”" assert scores.dim() == 4, ‘Score maps should be 4-dim’ maxval, idx = torch.max(scores.view(scores.size(0), scores.size(1), -1), 2)

    maxval = maxval.view(scores.size(0), scores.size(1), 1) idx = idx.view(scores.size(0), scores.size(1), 1) + 1

    preds = idx.repeat(1, 1, 2).float()

    preds[:, :, 0] = (preds[:, :, 0] - 1) % scores.size(3) + 1 preds[:, :, 1] = torch.floor((preds[:, :, 1] - 1) / scores.size(3)) + 1

    pred_mask = maxval.gt(0).repeat(1, 1, 2).float() preds *= pred_mask return preds`

Could you please help me? Any reply is appreciated.

0reactions
lhyfstcommented, Apr 25, 2022

same question

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capture and read bug reports - Android Developers
A bug report contains device logs, stack traces, and other diagnostic information to help you find and fix bugs in your app.
Read more >
What Is A Bug Report? The Essential Guide + Examples Of ...
A bug report is something that stores all information needed to document, report and fix problems occurred in software or on a website....
Read more >
How to Write A Good Bug Report? Tips and Tricks
“The point of writing a problem report (bug report) is to get bugs fixed” – By Cem Kaner. If a tester is not...
Read more >
14 Bug Reporting Templates You Can Copy for Your QA ...
Check out these 14 super actionable bug report templates, tailored for your issue tracker like Jira, GitHub, Trello, Asana, Excel and more.
Read more >
Bug Reporting - Apple Developer
Now with Feedback Assistant available on iPhone, iPad, Mac, and the web, it's easier to submit effective bug reports and request enhancements to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found