Skip to content

Commit

Permalink
[Fix] Modify the dtype of heatmap_weights to speed up the calculation (
Browse files Browse the repository at this point in the history
  • Loading branch information
Ginray authored Jan 3, 2024
1 parent df0a374 commit 6f7411c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmpose/codecs/spr.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _get_heatmap_weights(self,
Returns:
np.ndarray: Heatmap weight array in the same shape with heatmaps
"""
heatmap_weights = np.ones(heatmaps.shape) * bg_weight
heatmap_weights = np.ones(heatmaps.shape, dtype=np.float32) * bg_weight
heatmap_weights[heatmaps > 0] = fg_weight
return heatmap_weights

Expand Down

0 comments on commit 6f7411c

Please sign in to comment.