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

[jsk_perception/openpose] Add resize image #2300

Merged
merged 3 commits into from Nov 1, 2018

Conversation

Projects
None yet
4 participants
@iory
Copy link
Member

commented Jun 19, 2018

When a large image is input, we cannot allocate openpose's neural network on GPU memory.
So I added an option to resize for openpose nodelet.

@iory iory requested a review from furushchev Jun 26, 2018

@furushchev
Copy link
Contributor

left a comment

It looks the motivation is reasonable though nodes for resizing images already exists.(e.g. image_proc/resize)
How about putting resized images instead of big images?
Although adding a warning on such a case is very welcome.

If you'd like to add resize feature, I prefer adding an option to set target_width or target_height and resizing with the original aspect ratio to just adding both width and height.

@furushchev

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2018

Ah, I may just now understand the reason why you want to add resize on this node.
If the input image is resized before this node, output data in 2D image space (which is enabled when ~with_depth is False) is affected and need to be re-scaled according to the original image size.

@iory
Did you check on both ~with_depth is False (hence, positional data in output is in coordinates of the original 2D image) and ~with_depth is True (hence positional data is in 3D space)?
I asked because the current test case only checks if the output topic is published or not.
https://github.com/jsk-ros-pkg/jsk_recognition/blob/master/jsk_perception/test/people_pose_estimation_2d.test

If ok, I approve in my review.
(Optional) Improving the test code is also welcome. 👍

@@ -490,6 +503,8 @@ def _pose_estimate_chainer_backend(self, bgr_img):
bgr_img, joint_cands_indices, all_peaks, candidate)
else:
result_img = bgr_img
if not (self.width is None or self.height is None):
result_img = cv2.resize(result_img, (org_w, org_h))

return result_img, self._extract_joint_position(joint_cands_indices, candidate)

This comment has been minimized.

Copy link
@wkentaro

wkentaro Aug 3, 2018

Member

@iory self._extract_joint_position is not affected by resizing the input for the NN?

@k-okada k-okada added this to the 1.2.6 milestone Oct 17, 2018

@k-okada

This comment has been minimized.

Copy link
Member

commented Oct 17, 2018

waiting for test code? or @iory self._extract_joint_position is not affected by resizing the input for the NN? ?

@k-okada k-okada merged commit c7f0118 into jsk-ros-pkg:master Nov 1, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@k-okada

This comment has been minimized.

Copy link
Member

commented Nov 1, 2018

@iory : waiting for test code? or @iory self._extract_joint_position is not affected by resizing the input for the NN? ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.