From 81082719f516a01eb6f77d5f0c288c7f220c8641 Mon Sep 17 00:00:00 2001 From: tsampazk <27914645+tsampazk@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:36:14 +0300 Subject: [PATCH] Added rospy arguments with first argument skipping to fix running nodes from launch files --- .../scripts/audiovisual_emotion_recognition_node.py | 2 +- .../opendr_perception/scripts/binary_high_resolution_node.py | 2 +- .../scripts/continual_skeleton_based_action_recognition_node.py | 2 +- .../opendr_perception/scripts/continual_slam_dataset_node.py | 2 +- .../opendr_perception/scripts/continual_slam_learner_node.py | 2 +- .../opendr_perception/scripts/continual_slam_predictor_node.py | 2 +- .../opendr_perception/scripts/face_detection_retinaface_node.py | 2 +- .../src/opendr_perception/scripts/face_recognition_node.py | 2 +- .../opendr_perception/scripts/facial_emotion_estimation_node.py | 2 +- .../src/opendr_perception/scripts/fall_detection_node.py | 2 +- .../src/opendr_perception/scripts/gesture_recognition_node.py | 2 +- .../opendr_perception/scripts/heart_anomaly_detection_node.py | 2 +- .../src/opendr_perception/scripts/hr_pose_estimation_node.py | 2 +- .../src/opendr_perception/scripts/image_dataset_node.py | 2 +- .../landmark_based_facial_expression_recognition_node.py | 2 +- .../scripts/object_detection_2d_centernet_node.py | 2 +- .../opendr_perception/scripts/object_detection_2d_detr_node.py | 2 +- .../opendr_perception/scripts/object_detection_2d_gem_node.py | 2 +- .../scripts/object_detection_2d_nanodet_node.py | 2 +- .../opendr_perception/scripts/object_detection_2d_ssd_node.py | 2 +- .../scripts/object_detection_2d_yolov3_node.py | 2 +- .../scripts/object_detection_2d_yolov5_node.py | 2 +- .../opendr_perception/scripts/object_detection_3d_voxel_node.py | 2 +- .../scripts/object_tracking_2d_deep_sort_node.py | 2 +- .../scripts/object_tracking_2d_fair_mot_node.py | 2 +- .../scripts/object_tracking_2d_siamrpn_node.py | 2 +- .../scripts/object_tracking_3d_ab3dmot_node.py | 2 +- .../scripts/panoptic_segmentation_efficient_lps_node.py | 2 +- .../scripts/panoptic_segmentation_efficient_ps_node.py | 2 +- .../opendr_ws/src/opendr_perception/scripts/performance_node.py | 2 +- .../opendr_perception/scripts/point_cloud_2_publisher_node.py | 2 +- .../src/opendr_perception/scripts/point_cloud_dataset_node.py | 2 +- .../src/opendr_perception/scripts/pose_estimation_node.py | 2 +- .../scripts/rgbd_hand_gesture_recognition_node.py | 2 +- .../scripts/semantic_segmentation_bisenet_node.py | 2 +- .../scripts/skeleton_based_action_recognition_node.py | 2 +- .../scripts/speech_command_recognition_node.py | 2 +- .../src/opendr_perception/scripts/speech_transcription_node.py | 2 +- .../scripts/video_activity_recognition_node.py | 2 +- .../src/opendr_perception/scripts/wave_detection_node.py | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/projects/opendr_ws/src/opendr_perception/scripts/audiovisual_emotion_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/audiovisual_emotion_recognition_node.py index 89920b7c8e..d4efa2b037 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/audiovisual_emotion_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/audiovisual_emotion_recognition_node.py @@ -159,7 +159,7 @@ def select_distributed(m, n): return [i * n // m + n // (2 * m) for i in range(m help="Device to use (cpu, cuda)", choices=["cuda", "cpu"]) parser.add_argument("--buffer_size", type=float, default=3.6, help="Size of the audio buffer in seconds") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/binary_high_resolution_node.py b/projects/opendr_ws/src/opendr_perception/scripts/binary_high_resolution_node.py index a8d18cbcfc..21ce7b9956 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/binary_high_resolution_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/binary_high_resolution_node.py @@ -154,7 +154,7 @@ def main(): type=str, default="VGG_720p", choices=["VGG_720p", "VGG_1080p"]) parser.add_argument("--device", help="Device to use, either \"cpu\" or \"cuda\", defaults to \"cuda\"", type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/continual_skeleton_based_action_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/continual_skeleton_based_action_recognition_node.py index 2c16642785..bbfc8bd39e 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/continual_skeleton_based_action_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/continual_skeleton_based_action_recognition_node.py @@ -225,7 +225,7 @@ def main(): parser.add_argument("--model", help="Model to use, either \"costgcn\"", type=str, default="costgcn", choices=["costgcn"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_dataset_node.py b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_dataset_node.py index e1b97e0759..c309280baf 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_dataset_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_dataset_node.py @@ -136,7 +136,7 @@ def main(): help="ROS topic to publish distances") parser.add_argument("--dataset_fps", type=float, default=3, help="Dataset frame rate") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) node = ContinualSlamDatasetNode(args.dataset_path, args.config_file_path, diff --git a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_learner_node.py b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_learner_node.py index 371cf759dd..4a41bd002f 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_learner_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_learner_node.py @@ -269,7 +269,7 @@ def main(): action='store_false', default=True, help='Whether to save memory or not. Add it to the command if you want to write to disk') - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) node = ContinualSlamLearner(args.config_path, args.input_image_topic, diff --git a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_predictor_node.py b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_predictor_node.py index ee6dc73776..e8117f0252 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_predictor_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/continual_slam_predictor_node.py @@ -328,7 +328,7 @@ def main(): type=str, default='/cl_slam/update', help='Update topic, listened from Continual SLAM Dataset Node') - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) node = ContinualSlamPredictor(args.config_path, args.input_image_topic, diff --git a/projects/opendr_ws/src/opendr_perception/scripts/face_detection_retinaface_node.py b/projects/opendr_ws/src/opendr_perception/scripts/face_detection_retinaface_node.py index 944c216c52..a9a64faa18 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/face_detection_retinaface_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/face_detection_retinaface_node.py @@ -138,7 +138,7 @@ def main(): help="Retinaface backbone, options are either 'mnet' or 'resnet', where 'mnet' detects " "masked faces as well", type=str, default="resnet", choices=["resnet", "mnet"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and mx.context.num_gpus() > 0: diff --git a/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py index b4012998ed..5acc0cd1f0 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py @@ -180,7 +180,7 @@ def main(): help="Path of the directory where the images of the faces to be recognized are stored, " "defaults to \"./database\"", type=str, default="./database") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/facial_emotion_estimation_node.py b/projects/opendr_ws/src/opendr_perception/scripts/facial_emotion_estimation_node.py index 673ec1dda9..2dd27658e8 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/facial_emotion_estimation_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/facial_emotion_estimation_node.py @@ -202,7 +202,7 @@ def _pre_process_input_image(image): type=str, default=None) parser.add_argument('-d', '--device', help='Device to use, either cpu or cuda', type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/fall_detection_node.py b/projects/opendr_ws/src/opendr_perception/scripts/fall_detection_node.py index 6b3f760047..9191f32510 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/fall_detection_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/fall_detection_node.py @@ -229,7 +229,7 @@ def main(): parser.add_argument("--accelerate", help="Enables acceleration flags for pose estimation which runs when an " "input_rgb_image_topic is provided (e.g., stride)", default=False, action="store_true") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/gesture_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/gesture_recognition_node.py index 09ffb2ffcc..99d962d151 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/gesture_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/gesture_recognition_node.py @@ -133,7 +133,7 @@ def main(): parser.add_argument("--device", help="Device to use (cpu, cuda)", type=str, default="cpu", choices=["cuda", "cpu"]) parser.add_argument("--threshold", help="Confidence threshold for prediction", type=float, default=0.5) parser.add_argument("--model", help="Model that config file will be used", type=str, default="plus_m_1.5x_416") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/heart_anomaly_detection_node.py b/projects/opendr_ws/src/opendr_perception/scripts/heart_anomaly_detection_node.py index 9b6d764719..ee716d0a64 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/heart_anomaly_detection_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/heart_anomaly_detection_node.py @@ -117,7 +117,7 @@ def callback(self, msg_data): parser.add_argument("--model", type=str, default="anbof", help="model to be used for prediction: anbof or gru", choices=["anbof", "gru"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/hr_pose_estimation_node.py b/projects/opendr_ws/src/opendr_perception/scripts/hr_pose_estimation_node.py index bcaebcf00b..6da2f0e60f 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/hr_pose_estimation_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/hr_pose_estimation_node.py @@ -149,7 +149,7 @@ def main(): type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--accelerate", help="Enables acceleration flags (e.g., stride)", default=False, action="store_true") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/image_dataset_node.py b/projects/opendr_ws/src/opendr_perception/scripts/image_dataset_node.py index 9a738932eb..ab41a5353f 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/image_dataset_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/image_dataset_node.py @@ -72,7 +72,7 @@ def main(): type=str, default="/opendr/dataset_image") parser.add_argument("-f", "--fps", help="Data FPS", type=float, default=30) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) dataset_path = args.dataset_path mot20_subsets_path = args.mot20_subsets_path diff --git a/projects/opendr_ws/src/opendr_perception/scripts/landmark_based_facial_expression_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/landmark_based_facial_expression_recognition_node.py index 3ae130fff6..58aa91a85c 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/landmark_based_facial_expression_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/landmark_based_facial_expression_recognition_node.py @@ -168,7 +168,7 @@ def _landmark2numpy(landmarks): type=str, default="pstbln_afew", choices=['pstbln_ck+', 'pstbln_casia', 'pstbln_afew']) parser.add_argument("-s", "--shape_predictor", help="Shape predictor (landmark_extractor) to use", type=str, default='./predictor_path') - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_centernet_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_centernet_node.py index 082d238f27..d037516833 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_centernet_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_centernet_node.py @@ -133,7 +133,7 @@ def main(): parser.add_argument("--device", help="Device to use (cpu, cuda)", type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--backbone", help="Backbone network, defaults to \"resnet50_v1b\"", type=str, default="resnet50_v1b", choices=["resnet50_v1b"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and mx.context.num_gpus() > 0: diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_detr_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_detr_node.py index 6a64caef83..1c37744d28 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_detr_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_detr_node.py @@ -226,7 +226,7 @@ def main(): type=str, default=None) parser.add_argument("--device", help="Device to use, either \"cpu\" or \"cuda\", defaults to \"cuda\"", type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_gem_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_gem_node.py index 67b8563e03..200b6df28a 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_gem_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_gem_node.py @@ -269,7 +269,7 @@ def callback(self, msg_rgb, msg_ir): type=str, default=None) parser.add_argument("--device", help='Device to use, either "cpu" or "cuda", defaults to "cuda"', type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_nanodet_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_nanodet_node.py index 3b09dd6d32..dd3c4b0e97 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_nanodet_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_nanodet_node.py @@ -132,7 +132,7 @@ def main(): type=str, default=None) parser.add_argument("--device", help="Device to use (cpu, cuda)", type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--model", help="Model that config file will be used", type=str, default="plus_m_1.5x_416") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_ssd_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_ssd_node.py index ee06245957..390f834e31 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_ssd_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_ssd_node.py @@ -160,7 +160,7 @@ def main(): "\"seq2seq-nms\", \"soft-nms\", \"fast-nms\", \"cluster-nms\"", type=str, default="default", choices=["default", "seq2seq-nms", "soft-nms", "fast-nms", "cluster-nms"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and mx.context.num_gpus() > 0: diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov3_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov3_node.py index 1e4f4bd8e9..1a5d531c87 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov3_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov3_node.py @@ -134,7 +134,7 @@ def main(): type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--backbone", help="Backbone network, defaults to \"darknet53\"", type=str, default="darknet53", choices=["darknet53"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and mx.context.num_gpus() > 0: diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov5_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov5_node.py index 596511bacf..22bfcf5625 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov5_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_2d_yolov5_node.py @@ -133,7 +133,7 @@ def main(): parser.add_argument("--model_name", help="Network architecture, defaults to \"yolov5s\"", type=str, default="yolov5s", choices=['yolov5s', 'yolov5n', 'yolov5m', 'yolov5l', 'yolov5x', 'yolov5n6', 'yolov5s6', 'yolov5m6', 'yolov5l6', 'custom']) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_3d_voxel_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_3d_voxel_node.py index 4eba14dfa1..08f4dd7880 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_detection_3d_voxel_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_detection_3d_voxel_node.py @@ -135,7 +135,7 @@ def main(): ) parser.add_argument("-t", "--temp_dir", help="Path to a temporary directory with models", type=str, default="temp") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_deep_sort_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_deep_sort_node.py index 2852923a52..f4eeba0524 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_deep_sort_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_deep_sort_node.py @@ -221,7 +221,7 @@ def main(): type=str, default="deep_sort", choices=["deep_sort"]) parser.add_argument("-td", "--temp_dir", help="Path to a temporary directory with models", type=str, default="temp") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_fair_mot_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_fair_mot_node.py index 068fc37fed..9665abd8ec 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_fair_mot_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_fair_mot_node.py @@ -214,7 +214,7 @@ def main(): type=str, default="fairmot_dla34", choices=["fairmot_dla34"]) parser.add_argument("-td", "--temp_dir", help="Path to a temporary directory with models", type=str, default="temp") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_siamrpn_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_siamrpn_node.py index 4f60355756..0674597e48 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_siamrpn_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_2d_siamrpn_node.py @@ -172,7 +172,7 @@ def main(): type=str, default=None) parser.add_argument("--device", help="Device to use, either \"cpu\" or \"cuda\", defaults to \"cuda\"", type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and mx.context.num_gpus() > 0: diff --git a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_3d_ab3dmot_node.py b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_3d_ab3dmot_node.py index 088897b78f..ed603e1223 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_3d_ab3dmot_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/object_tracking_3d_ab3dmot_node.py @@ -148,7 +148,7 @@ def main(): ) parser.add_argument("-td", "--temp_dir", help="Path to a temporary directory with models", type=str, default="temp") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) input_point_cloud_topic = args.input_point_cloud_topic detector_model_name = args.detector_model_name diff --git a/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_lps_node.py b/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_lps_node.py index 065df1fe65..c04cbd41d5 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_lps_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_lps_node.py @@ -176,7 +176,7 @@ def callback(self, data: ROS_PointCloud2): parser.add_argument("--performance_topic", help="Topic name for performance messages, disabled (None) by default", type=str, default=None) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) efficient_lps_node = EfficientLpsNode(args.input_point_cloud_2_topic, args.checkpoint, diff --git a/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_ps_node.py b/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_ps_node.py index 633cf25cde..482131f576 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_ps_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/panoptic_segmentation_efficient_ps_node.py @@ -193,7 +193,7 @@ def callback(self, data: ROS_Image): panoptic segmentation maps and publish it on OUTPUT_RGB_IMAGE_TOPIC') parser.add_argument('--checkpoint', type=str, default='cityscapes', help='download pretrained models [cityscapes, kitti] or load from the provided path') - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) efficient_ps_node = EfficientPsNode(args.input_rgb_image_topic, args.checkpoint, diff --git a/projects/opendr_ws/src/opendr_perception/scripts/performance_node.py b/projects/opendr_ws/src/opendr_perception/scripts/performance_node.py index 126445b846..eaa923eaf8 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/performance_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/performance_node.py @@ -65,7 +65,7 @@ def main(): type=str, default="/opendr/performance") parser.add_argument("-w", "--window", help="The window to use in frames to calculate running average FPS", type=int, default=20) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) performance_node = PerformanceNode(input_performance_topic=args.input_performance_topic, window_length=args.window) diff --git a/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_2_publisher_node.py b/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_2_publisher_node.py index 3a20b10bde..ac3688ba8d 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_2_publisher_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_2_publisher_node.py @@ -92,7 +92,7 @@ def _init_dataset(self): help='topic for the output point cloud') parser.add_argument('-t', '--test_data', action='store_true', help='Use uploaded test data on the FTP server') - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) if args.test_data: args.dataset_path = EfficientLpsLearner.download(args.dataset_path, mode="test_data", prepare_data=True) diff --git a/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_dataset_node.py b/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_dataset_node.py index cb7abf8bf2..dd27ab5c66 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_dataset_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/point_cloud_dataset_node.py @@ -69,7 +69,7 @@ def main(): type=str, default="/opendr/dataset_point_cloud") parser.add_argument("-f", "--fps", help="Data FPS", type=float, default=10) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) dataset_path = args.dataset_path kitti_subsets_path = args.kitti_subsets_path diff --git a/projects/opendr_ws/src/opendr_perception/scripts/pose_estimation_node.py b/projects/opendr_ws/src/opendr_perception/scripts/pose_estimation_node.py index 255216ff4e..cce48c4951 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/pose_estimation_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/pose_estimation_node.py @@ -147,7 +147,7 @@ def main(): type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--accelerate", help="Enables acceleration flags (e.g., stride)", default=False, action="store_true") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/rgbd_hand_gesture_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/rgbd_hand_gesture_recognition_node.py index 1d663c319e..8d78927276 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/rgbd_hand_gesture_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/rgbd_hand_gesture_recognition_node.py @@ -165,7 +165,7 @@ def preprocess(self, rgb_image, depth_image): parser.add_argument("--delay", help="The delay (in seconds) with which RGB message and" "depth message can be synchronized", type=float, default=0.1) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/semantic_segmentation_bisenet_node.py b/projects/opendr_ws/src/opendr_perception/scripts/semantic_segmentation_bisenet_node.py index 149e023c29..fd24ba82b0 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/semantic_segmentation_bisenet_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/semantic_segmentation_bisenet_node.py @@ -189,7 +189,7 @@ def main(): type=str, default=None) parser.add_argument("--device", help="Device to use, either \"cpu\" or \"cuda\", defaults to \"cuda\"", type=str, default="cuda", choices=["cuda", "cpu"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/skeleton_based_action_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/skeleton_based_action_recognition_node.py index c5bab115dd..a09e3bd0fd 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/skeleton_based_action_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/skeleton_based_action_recognition_node.py @@ -232,7 +232,7 @@ def _pose2numpy(num_current_frames, poses_list): parser.add_argument("--model", help="Model to use, either \"stgcn\" or \"pstgcn\"", type=str, default="stgcn", choices=["stgcn", "pstgcn"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/speech_command_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/speech_command_recognition_node.py index 430581cf52..039c784392 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/speech_command_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/speech_command_recognition_node.py @@ -139,7 +139,7 @@ def callback(self, msg_data): help="Model to be used for prediction: matchboxnet, edgespeechnets or quad_selfonn") parser.add_argument("--model_path", type=str, help="Path to the model files, if not given, the pretrained model will be downloaded") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/speech_transcription_node.py b/projects/opendr_ws/src/opendr_perception/scripts/speech_transcription_node.py index 2cc2201a2b..5108ae1cdb 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/speech_transcription_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/speech_transcription_node.py @@ -501,7 +501,7 @@ def main(): "--sample_rate", type=int, default=16000, help="Sampling rate for audio data." "Check your audio source for correct value." ) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/video_activity_recognition_node.py b/projects/opendr_ws/src/opendr_perception/scripts/video_activity_recognition_node.py index 2f80affc39..ff1171cd50 100755 --- a/projects/opendr_ws/src/opendr_perception/scripts/video_activity_recognition_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/video_activity_recognition_node.py @@ -243,7 +243,7 @@ def main(): parser.add_argument("--model", help="Architecture to use for human activity recognition.", type=str, default="cox3d-m", choices=["cox3d-s", "cox3d-m", "cox3d-l", "x3d-xs", "x3d-s", "x3d-m", "x3d-l"]) - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available(): diff --git a/projects/opendr_ws/src/opendr_perception/scripts/wave_detection_node.py b/projects/opendr_ws/src/opendr_perception/scripts/wave_detection_node.py index 173dbb99f5..584bbfb717 100644 --- a/projects/opendr_ws/src/opendr_perception/scripts/wave_detection_node.py +++ b/projects/opendr_ws/src/opendr_perception/scripts/wave_detection_node.py @@ -322,7 +322,7 @@ def main(): type=str, default="cuda", choices=["cuda", "cpu"]) parser.add_argument("--accelerate", help="Enables acceleration flags (e.g., stride)", default=False, action="store_true") - args = parser.parse_args() + args = parser.parse_args(rospy.myargv()[1:]) try: if args.device == "cuda" and torch.cuda.is_available():