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

Custom optimizer #132

Merged
merged 21 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clamp kpts values
  • Loading branch information
JSabadin committed Nov 19, 2024
commit 4c61f3823dcf97ad918b6bbd83e1003b6a595968
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def draw_predictions(
prediction = predictions[i]
mask = prediction[..., 2] < visibility_threshold
visible_kpts = prediction[..., :2] * (~mask).unsqueeze(-1).float()
visible_kpts[..., 0] = torch.clamp(
visible_kpts[..., 0], 0, canvas.size(-1) - 1
)
visible_kpts[..., 1] = torch.clamp(
visible_kpts[..., 1], 0, canvas.size(-2) - 1
)
viz[i] = draw_keypoints(
canvas[i].clone(),
visible_kpts[..., :2],
Expand Down
Loading