From 90751a8ae69efcc64725ae2bcc5e5b8210ce91ac Mon Sep 17 00:00:00 2001 From: Kanazawanaoaki Date: Thu, 12 Oct 2023 02:58:57 +0900 Subject: [PATCH 01/12] Add Cosine Similarity description in clip vis string msg --- jsk_perception/src/jsk_perception/vil_inference_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsk_perception/src/jsk_perception/vil_inference_client.py b/jsk_perception/src/jsk_perception/vil_inference_client.py index e42948a2c7..39428c75d9 100644 --- a/jsk_perception/src/jsk_perception/vil_inference_client.py +++ b/jsk_perception/src/jsk_perception/vil_inference_client.py @@ -155,9 +155,9 @@ def topic_cb(self, data): vis_msg = "" for i, label in enumerate(msg.label_names): vis_msg += "{}: {:.2f}% ".format(label, msg.probabilities[i]*100) - vis_msg += "\n" + vis_msg += "\n\nCosine Similarity\n" for i, label in enumerate(msg.label_names): - vis_msg += "{}: {:.2f}% ".format(label, msg.label_proba[i]*100) + vis_msg += "{}: {:.4f} ".format(label, msg.label_proba[i]*100) self.vis_pub.publish(vis_msg) def create_queries(self, goal): From 9b684c8280979c949b465e1837f0f4a5ebd482d4 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Fri, 13 Oct 2023 14:42:05 +0900 Subject: [PATCH 02/12] [doc] Add explanation of sending multiple questions in vqa_node --- doc/jsk_perception/nodes/vqa_node.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/jsk_perception/nodes/vqa_node.md b/doc/jsk_perception/nodes/vqa_node.md index b2c8056586..69bd250094 100644 --- a/doc/jsk_perception/nodes/vqa_node.md +++ b/doc/jsk_perception/nodes/vqa_node.md @@ -62,7 +62,12 @@ make * `~questions` (string, default: `what does this image describe?`) Default questions used for subscribing image topic. - + + We can send multiple questions with separating semicolon like the below. + ``` + What does this image describe?; What kinds of objects exists? + ``` + ## Sample ### Run inference container on another host or another terminal From 2aa3a838d97444494f86f0103cc511f264cac22e Mon Sep 17 00:00:00 2001 From: Kanazawanaoaki Date: Fri, 13 Oct 2023 18:47:41 +0900 Subject: [PATCH 03/12] Fix: Display the cosine similarity without multiplying by 100 --- jsk_perception/src/jsk_perception/vil_inference_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsk_perception/src/jsk_perception/vil_inference_client.py b/jsk_perception/src/jsk_perception/vil_inference_client.py index 39428c75d9..212334f1b3 100644 --- a/jsk_perception/src/jsk_perception/vil_inference_client.py +++ b/jsk_perception/src/jsk_perception/vil_inference_client.py @@ -157,7 +157,7 @@ def topic_cb(self, data): vis_msg += "{}: {:.2f}% ".format(label, msg.probabilities[i]*100) vis_msg += "\n\nCosine Similarity\n" for i, label in enumerate(msg.label_names): - vis_msg += "{}: {:.4f} ".format(label, msg.label_proba[i]*100) + vis_msg += "{}: {:.4f} ".format(label, msg.label_proba[i]) self.vis_pub.publish(vis_msg) def create_queries(self, goal): From c2a8b92d896ca610c76c7ce70811cf65b7d5bae8 Mon Sep 17 00:00:00 2001 From: Aoi Nakane Date: Sun, 15 Oct 2023 21:41:48 +0900 Subject: [PATCH 04/12] [doc] Rename install_chainer_gpu.rst to install_chainer_gpu.md --- doc/{install_chainer_gpu.rst => install_chainer_gpu.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/{install_chainer_gpu.rst => install_chainer_gpu.md} (100%) diff --git a/doc/install_chainer_gpu.rst b/doc/install_chainer_gpu.md similarity index 100% rename from doc/install_chainer_gpu.rst rename to doc/install_chainer_gpu.md From efbae4eab413d213dc7948432d6eacdb0e7c3e00 Mon Sep 17 00:00:00 2001 From: Aoi Nakane Date: Sun, 15 Oct 2023 21:56:07 +0900 Subject: [PATCH 05/12] [doc] Fix rst expressions --- doc/install_chainer_gpu.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/install_chainer_gpu.md b/doc/install_chainer_gpu.md index ce5fc43147..54a721694a 100644 --- a/doc/install_chainer_gpu.md +++ b/doc/install_chainer_gpu.md @@ -45,7 +45,7 @@ Version Compatibilities for 18.04 Install CUDA ------------ -- Ubuntu 14.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux:: +- Ubuntu 14.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux: ```bash # If you'd like to use CUDA8.0 on Ubuntu 14.04. @@ -56,7 +56,7 @@ Install CUDA sudo apt-get install cuda ``` - - Add below to your `~/.bashrc`:: + - Add below to your `~/.bashrc`: ```bash # setup cuda & cudnn @@ -76,7 +76,7 @@ Install CUDA ``` -- Ubuntu 16.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux:: +- Ubuntu 16.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux: ```bash # If you'd like to use CUDA9.2 on Ubuntu 16.04. @@ -91,7 +91,7 @@ Install CUDA sudo apt install nvidia-cuda-toolkit sudo apt install nvidia-cuda-dev -- (Experimental) Ubuntu 18.04 : CUDA 10.2 is the latest version which supports `jsk_perception`. Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux:: +- (Experimental) Ubuntu 18.04 : CUDA 10.2 is the latest version which supports `jsk_perception`. Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux: ```bash # If you'd like to use CUDA10.2 on Ubuntu 18.04. @@ -156,7 +156,7 @@ Install Cupy - (Default) Chainer 6.7.0 requires CuPy 6.7.0 and if you have CUDA 9.1, you can use CuPy pre-compiled binary package. - - Pre-compiled Install Cupy for CUDA 9.1 :: + - Pre-compiled Install Cupy for CUDA 9.1 : ```bash sudo pip install cupy-cuda91==6.7.0 @@ -164,7 +164,7 @@ Install Cupy - (Experimental) If you have newer CUDA version. You need to install CuPy with source distribution. This requires CUDNN before you run `pip install cupy` . - - Source Install Cupy for CUDA 10.2 :: + - Source Install Cupy for CUDA 10.2 : ```bash sudo pip install -vvv cupy --no-cache-dir @@ -192,7 +192,7 @@ Install PyTorch Try Chainer Samples ----------- -You can try to run samples to check if the installation succeeded:: +You can try to run samples to check if the installation succeeded: roslaunch jsk_perception sample_fcn_object_segmentation.launch gpu:=0 roslaunch jsk_perception sample_people_pose_estimation_2d.launch GPU:=0 @@ -201,7 +201,7 @@ You can try to run samples to check if the installation succeeded:: Try PyTorch Samples ----------- -You can try to run samples to check if the installation succeeded:: +You can try to run samples to check if the installation succeeded: roslaunch jsk_perception sample_hand_pose_estimation_2d.launch gpu:=0 From fd8235c5c8de0722f29e4145202a2c108f90c438 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Sun, 15 Oct 2023 22:54:30 +0900 Subject: [PATCH 06/12] [doc] Add multiple queries explanation to classification_node.md --- doc/jsk_perception/nodes/classification_node.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/jsk_perception/nodes/classification_node.md b/doc/jsk_perception/nodes/classification_node.md index 6afa8abaed..5bdbf5945f 100644 --- a/doc/jsk_perception/nodes/classification_node.md +++ b/doc/jsk_perception/nodes/classification_node.md @@ -60,7 +60,9 @@ make ## Dynamic Reconfigure Parameters * `~queries` (string, default: `human;kettle;cup;glass`) - Default categories used for subscribing image topic. + Default categories used for subscribing image topic. + + We can send multiple queries with separating semicolon. ### Run inference container on another host or another terminal In the remote GPU machine, From 2e4344f6dede4641af5fdba68f9d9545f6b72557 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Sun, 15 Oct 2023 22:56:29 +0900 Subject: [PATCH 07/12] [doc] Adapt personal pronoun to existing writing style --- doc/jsk_perception/nodes/classification_node.md | 2 +- doc/jsk_perception/nodes/vqa_node.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/jsk_perception/nodes/classification_node.md b/doc/jsk_perception/nodes/classification_node.md index 5bdbf5945f..3262618c48 100644 --- a/doc/jsk_perception/nodes/classification_node.md +++ b/doc/jsk_perception/nodes/classification_node.md @@ -62,7 +62,7 @@ make Default categories used for subscribing image topic. - We can send multiple queries with separating semicolon. + You can send multiple queries with separating semicolon. ### Run inference container on another host or another terminal In the remote GPU machine, diff --git a/doc/jsk_perception/nodes/vqa_node.md b/doc/jsk_perception/nodes/vqa_node.md index 69bd250094..68cd3aee80 100644 --- a/doc/jsk_perception/nodes/vqa_node.md +++ b/doc/jsk_perception/nodes/vqa_node.md @@ -63,7 +63,7 @@ make Default questions used for subscribing image topic. - We can send multiple questions with separating semicolon like the below. + You can send multiple questions with separating semicolon like the below. ``` What does this image describe?; What kinds of objects exists? ``` From 2da11efde5f96fc1795a908c2320f626e3b04676 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Sun, 15 Oct 2023 22:57:28 +0900 Subject: [PATCH 08/12] [doc] Remove unnecessary space from questions parameter --- doc/jsk_perception/nodes/vqa_node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/jsk_perception/nodes/vqa_node.md b/doc/jsk_perception/nodes/vqa_node.md index 68cd3aee80..f31f0c0498 100644 --- a/doc/jsk_perception/nodes/vqa_node.md +++ b/doc/jsk_perception/nodes/vqa_node.md @@ -65,7 +65,7 @@ make You can send multiple questions with separating semicolon like the below. ``` - What does this image describe?; What kinds of objects exists? + What does this image describe?;What kinds of objects exists? ``` ## Sample From 6f2e83dbc34d64dc0f9bc8a267a35cf6fb3cee19 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Tue, 17 Oct 2023 17:28:53 +0900 Subject: [PATCH 09/12] [jsk_perception] Support compressed type image in vil_inference_client.py --- .../jsk_perception/vil_inference_client.py | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/jsk_perception/src/jsk_perception/vil_inference_client.py b/jsk_perception/src/jsk_perception/vil_inference_client.py index e42948a2c7..77e12fc725 100644 --- a/jsk_perception/src/jsk_perception/vil_inference_client.py +++ b/jsk_perception/src/jsk_perception/vil_inference_client.py @@ -39,13 +39,27 @@ def __init__(self, action, # default inference image self.default_img = None # ROS - self.image_sub = rospy.Subscriber("~image", Image, - callback=self.topic_cb, - queue_size=1, - buff_size=2**26) + self.transport_hint = rospy.get_param('~image_transport', 'raw') + if self.transport_hint == 'compressed': + self.image_sub = rospy.Subscriber( + "{}/compressed".format(rospy.resolve_name('~image')), + CompressedImage, + callback=self.topic_cb, + queue_size=1, + buff_size=2**26 + ) + + else: + self.image_sub = rospy.Subscriber("~image", Image, + callback=self.topic_cb, + queue_size=1, + buff_size=2**26) self.result_topic_type = result_topic self.result_pub = rospy.Publisher("~result", result_topic, queue_size=1) - self.image_pub = rospy.Publisher("~result/image", Image, queue_size=1) + if self.transport_hint == 'compressed': + self.image_pub = rospy.Publisher("~result/image/compressed", CompressedImage, queue_size=1) + else: + self.image_pub = rospy.Publisher("~result/image", Image, queue_size=1) self.vis_pub = rospy.Publisher("~visualize", String, queue_size=1) self.action_server = actionlib.SimpleActionServer("~inference_server", action, From 9b2d847c11b34bc08f21fcd4d0a312e966a57c57 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Thu, 19 Oct 2023 12:38:18 +0900 Subject: [PATCH 10/12] [doc] Fix links to markdown format --- doc/install_chainer_gpu.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/install_chainer_gpu.md b/doc/install_chainer_gpu.md index 54a721694a..d601aae053 100644 --- a/doc/install_chainer_gpu.md +++ b/doc/install_chainer_gpu.md @@ -15,37 +15,37 @@ Requirements Version Compatibilities for 18.04 --------------------------------- -(Recommended) Use CUDA 9.1 from Official ubuntu repository (https://packages.ubuntu.com/bionic/nvidia-cuda-dev) +(Recommended) Use CUDA 9.1 from Official ubuntu repository [https://packages.ubuntu.com/bionic/nvidia-cuda-dev](https://packages.ubuntu.com/bionic/nvidia-cuda-dev) - Chainer - - chainer == 6.7.0 (last version supoprting python2. See https://github.com/chainer/chainer/releases/tag/v6.7.0) - - cupy-cuda91 == 6.7.0 (chainer v6.7.0 requires cupy/cudnn for hardware acceleration support https://docs.chainer.org/en/v6.7.0/install.html) + - chainer == 6.7.0 (last version supoprting python2. See [https://github.com/chainer/chainer/releases/tag/v6.7.0](https://github.com/chainer/chainer/releases/tag/v6.7.0) + - cupy-cuda91 == 6.7.0 (chainer v6.7.0 requires cupy/cudnn for hardware acceleration support [https://docs.chainer.org/en/v6.7.0/install.html](https://docs.chainer.org/en/v6.7.0/install.html) - PyTorch - - pytorch == 1.1.0 (Latest pytorch version supporting CUDA 9.1 https://download.pytorch.org/whl/cu90/torch_stable.html) - - CUDA >= 9.0 (Minimum required version for PyTorch 1.1.0 https://pytorch.org/get-started/previous-versions/#v110) + - pytorch == 1.1.0 (Latest pytorch version supporting CUDA 9.1 [https://download.pytorch.org/whl/cu90/torch_stable.html](https://download.pytorch.org/whl/cu90/torch_stable.html) + - CUDA >= 9.0 (Minimum required version for PyTorch 1.1.0 [https://pytorch.org/get-started/previous-versions/#v110](https://pytorch.org/get-started/previous-versions/#v110) -(Experimental) Use CUDA 10.2 from Nvidia Developer's site (https://developer.nvidia.com/cuda-10.2-download-archive) +(Experimental) Use CUDA 10.2 from Nvidia Developer's site [https://developer.nvidia.com/cuda-10.2-download-archive](https://developer.nvidia.com/cuda-10.2-download-archive) - Chainer - - chainer == 6.7.0 (last version supoprting python2. See https://github.com/chainer/chainer/releases/tag/v6.7.0) - - cupy >=6.7.0,<7.0.0 (chainer v6.7.0 requires cupy/cudnn for hardware acceleration support https://docs.chainer.org/en/v6.7.0/install.html) + - chainer == 6.7.0 (last version supoprting python2. See [https://github.com/chainer/chainer/releases/tag/v6.7.0](https://github.com/chainer/chainer/releases/tag/v6.7.0) + - cupy >=6.7.0,<7.0.0 (chainer v6.7.0 requires cupy/cudnn for hardware acceleration support [https://docs.chainer.org/en/v6.7.0/install.html](https://docs.chainer.org/en/v6.7.0/install.html) - cuDNN < 8 (cupy 6.7.0 requires cuDNN v5000= and <=v7999) - - CUDA 10.2 (cuDNN v7.6.5 requires CUDA 10.2 https://developer.nvidia.com/rdp/cudnn-archive) + - CUDA 10.2 (cuDNN v7.6.5 requires CUDA 10.2 [https://developer.nvidia.com/rdp/cudnn-archive](https://developer.nvidia.com/rdp/cudnn-archive)) - PyTorch - pytorch >= 1.4.0 - - CUDA >= 9.2 (Minimum required version for PyTorch https://pytorch.org/get-started/previous-versions/#v140) - - Driver Version >= 396.26 (From CUDA Toolkit and Corresponding Driver Versions in https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html) + - CUDA >= 9.2 (Minimum required version for PyTorch [https://pytorch.org/get-started/previous-versions/#v140](https://pytorch.org/get-started/previous-versions/#v140) + - Driver Version >= 396.26 (From CUDA Toolkit and Corresponding Driver Versions in [https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html](https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html) Install CUDA ------------ -- Ubuntu 14.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux: +- Ubuntu 14.04 : Download deb file from [https://developer.nvidia.com/cuda-downloads?target_os=Linux](https://developer.nvidia.com/cuda-downloads?target_os=Linux): ```bash # If you'd like to use CUDA8.0 on Ubuntu 14.04. @@ -76,7 +76,7 @@ Install CUDA ``` -- Ubuntu 16.04 : Download deb file from https://developer.nvidia.com/cuda-downloads?target_os=Linux: +- Ubuntu 16.04 : Download deb file from [https://developer.nvidia.com/cuda-downloads?target_os=Linux](https://developer.nvidia.com/cuda-downloads?target_os=Linux): ```bash # If you'd like to use CUDA9.2 on Ubuntu 16.04. @@ -124,11 +124,11 @@ Install CUDA Install CUDNN ------------- -- If you install `pip install cupy-cuda91`, you do not need to install CUDNN manually. (c.f. https://github.com/jsk-ros-pkg/jsk_visualization/issues/809). Thus, default 18.04 user can use CUDA 9.1 and `cupy-cuda91==6.7.0` for `chainer==6.7.0` and you can SKIP this section. +- If you install `pip install cupy-cuda91`, you do not need to install CUDNN manually. (c.f. [https://github.com/jsk-ros-pkg/jsk_visualization/issues/809](https://github.com/jsk-ros-pkg/jsk_visualization/issues/809)). Thus, default 18.04 user can use CUDA 9.1 and `cupy-cuda91==6.7.0` for `chainer==6.7.0` and you can SKIP this section. Installing CUDNN manually only requires for experimental user who install CUDA 10.2 manually. -- You need to login at https://developer.nvidia.com/cudnn +- You need to login at [https://developer.nvidia.com/cudnn](https://developer.nvidia.com/cudnn) - Go to cuDNN Download and choose version - Download deb files of cuDNN Runtime Library and cuDNN Developer Library @@ -174,7 +174,7 @@ Install Cupy Install PyTorch --------------- -- 18.04 provides CUDA 9.1 by defualt. To install PyTorch compatible with this version, download following wheel from https://download.pytorch.org/whl/cu90/torch_stable.html, and install manually. +- 18.04 provides CUDA 9.1 by defualt. To install PyTorch compatible with this version, download following wheel from [https://download.pytorch.org/whl/cu90/torch_stable.html](https://download.pytorch.org/whl/cu90/torch_stable.html), and install manually. ```bash sudo pip install torch-1.1.0-cp27-cp27mu-linux_x86_64.whl @@ -187,7 +187,7 @@ Install PyTorch sudo pip install torch==1.4.0 ``` -- See https://github.com/jsk-ros-pkg/jsk_recognition/pull/2601#issuecomment-876948260 for more info. +- See [https://github.com/jsk-ros-pkg/jsk_recognition/pull/2601#issuecomment-876948260](https://github.com/jsk-ros-pkg/jsk_recognition/pull/2601#issuecomment-876948260) for more info. Try Chainer Samples ----------- From 2a7a524d25e539a4b29cfbe649e11a97dd7d7573 Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Thu, 19 Oct 2023 12:45:50 +0900 Subject: [PATCH 11/12] [doc] Change a link to nvidia-cuda-dev package for bionic because package.ubuntu.com removes bionic packages page --- doc/install_chainer_gpu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install_chainer_gpu.md b/doc/install_chainer_gpu.md index d601aae053..cd4debf0b4 100644 --- a/doc/install_chainer_gpu.md +++ b/doc/install_chainer_gpu.md @@ -15,7 +15,7 @@ Requirements Version Compatibilities for 18.04 --------------------------------- -(Recommended) Use CUDA 9.1 from Official ubuntu repository [https://packages.ubuntu.com/bionic/nvidia-cuda-dev](https://packages.ubuntu.com/bionic/nvidia-cuda-dev) +(Recommended) Use CUDA 9.1 from Official ubuntu repository [https://launchpad.net/ubuntu/bionic/+package/nvidia-cuda-dev](https://launchpad.net/ubuntu/bionic/+package/nvidia-cuda-dev) - Chainer From 3d51fa8cea2dbd9aac083e252e9f351da22c487c Mon Sep 17 00:00:00 2001 From: Naoto Tsukamoto Date: Tue, 17 Oct 2023 17:30:56 +0900 Subject: [PATCH 12/12] [jsk_perception] Add image_transport arg to vil launch file --- jsk_perception/launch/classification.launch | 2 ++ jsk_perception/launch/vqa.launch | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jsk_perception/launch/classification.launch b/jsk_perception/launch/classification.launch index 7b8852ac78..fbf14fae0e 100644 --- a/jsk_perception/launch/classification.launch +++ b/jsk_perception/launch/classification.launch @@ -5,6 +5,7 @@ + @@ -14,6 +15,7 @@ host: $(arg host) port: $(arg port) + image_transport: $(arg image_transport) diff --git a/jsk_perception/launch/vqa.launch b/jsk_perception/launch/vqa.launch index a1e1ccfc69..32b3988b4b 100644 --- a/jsk_perception/launch/vqa.launch +++ b/jsk_perception/launch/vqa.launch @@ -5,6 +5,7 @@ + @@ -14,6 +15,7 @@ host: $(arg host) port: $(arg port) + image_transport: $(arg image_transport)