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

[Feature] Generate Heatmap #336

Merged
merged 5 commits into from
Jun 1, 2021
Merged

[Feature] Generate Heatmap #336

merged 5 commits into from
Jun 1, 2021

Conversation

Yshuo-Li
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #336 (9ec1723) into master (290c75e) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 9ec1723 differs from pull request most recent head c0c1ed3. Consider uploading reports for the commit c0c1ed3 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   79.98%   80.03%   +0.04%     
==========================================
  Files         180      180              
  Lines        9435     9465      +30     
  Branches     1377     1382       +5     
==========================================
+ Hits         7547     7575      +28     
- Misses       1698     1699       +1     
- Partials      190      191       +1     
Flag Coverage Δ
unittests 80.02% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmedit/datasets/pipelines/__init__.py 100.00% <100.00%> (ø)
mmedit/datasets/pipelines/generate_assistant.py 100.00% <100.00%> (ø)
...ls/components/stylegan2/generator_discriminator.py 84.93% <0.00%> (-1.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 085a277...c0c1ed3. Read the comment docs.


x_range = np.arange(start=0, stop=w, dtype=int)
y_range = np.arange(start=0, stop=h, dtype=int)
xx, yy = np.meshgrid(x_range, y_range)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if xx and yy are good names. How about grid_x and grid_y?

x_range = np.arange(start=0, stop=w, dtype=int)
y_range = np.arange(start=0, stop=h, dtype=int)
xx, yy = np.meshgrid(x_range, y_range)
d2 = (xx - keypoint[0])**2 + (yy - keypoint[1])**2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d2 -> dist?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually here d2 is better than dist, since it is distance squared.

@innerlee
Copy link
Contributor

innerlee commented May 31, 2021

Unrelated comment: we may find a way (maybe in next month) to reduce code duplication between mmedit and mmpose. cc. @jin-s13 @ly015

target_size = (target_size, target_size)
else:
target_size = target_size[:2]
self.rate = (target_size[0] / ori_size[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does rate mean here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resize heatmap

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay should be ratio. Choose target_ori_ratio/size_ratio/...

def __repr__(self):
return (f'{self.__class__.__name__}, '
f'keypoint={self.keypoint}, '
f'rate={self.rate}, target_size={self.target_size}, '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need to show rate here, since it is not a configurable parameter

@innerlee innerlee merged commit 6703c5d into open-mmlab:master Jun 1, 2021
@Yshuo-Li Yshuo-Li deleted the heatmap branch June 1, 2021 02:24
Yshuo-Li added a commit to Yshuo-Li/mmediting that referenced this pull request Jul 15, 2022
* [Feature] Generate Heatmap

* Rename

* Rename

* Update

* Update

Co-authored-by: liyinshuo <liyinshuo@sensetime.com>
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

Successfully merging this pull request may close these issues.

None yet

3 participants