diff --git a/ansible/roles/provision-files/vars/main.yml b/ansible/roles/provision-files/vars/main.yml index d4942605d..0660c1444 100644 --- a/ansible/roles/provision-files/vars/main.yml +++ b/ansible/roles/provision-files/vars/main.yml @@ -61,10 +61,10 @@ girder_file_downloads: sha512: 7ded5cb71ef0efe2444a19c7452073c63a34d65e3038b24236b304836abd47e8911e3d3023d2ba7e5a8d8c1e337e6f4b8e3080709827eb2b0daaedb0b6248561 dest: "{{ stage_dirs.pose_estimation }}/pose_model.pth" # Hand detector - - file_id: 6605ca2e8b763ca20ae99f77 - sha512: 42b56f34c0c443ad00d71e66334d6e852a7811011b22a60da9b5e2721565c21d1b5daad17c8a708908c9658ded81a663729090526feb5286bd0a591cf4fb5d8f - dest: "{{ stage_dirs.object_detector }}/hands_model.pt" - + - file_id: 6710037cba16447d41e1663a + sha512: cf6a20a966dcaee46354545ef5d2086f2dcf31112eb90282e5dd6a24824a584d5e549274112f6f028911050a48bcaba6c944e5d3d870edcafe2fcd34e61d95f5 + dest: "{{ stage_dirs.object_detector }}/hands_model.engine" + # ---- M2 ---- # Object detector - file_id: 6617e7ce2357cf6b55ca8dd6 @@ -98,7 +98,7 @@ girder_file_downloads: - file_id: 660ebb1baa5c8de3874c43c3 sha512: fae5d696d6b1a03daa52a8094b8be8f6cc675cd3487270dbfee212551813869af22eedbcc1dc89bd62bbebdfa411819a8584083e198c3d6ab0b35f266a524054 dest: "{{ stage_dirs.task_monitor }}/m3_test_activity_preds.mscoco.json" - + # ---- M5 ---- # Object detector - file_id: 6605e0808b763ca20ae99f92 @@ -115,7 +115,7 @@ girder_file_downloads: - file_id: 660ebb1caa5c8de3874c43c6 sha512: 8e2f77310455460b9e0769d78469d752fca2313a31ed498ddd4eeb4b6b501cbee6f069e4f3c9921f6db2e77f07a2e2ad47714afb80617d08df775bcdcbd15168 dest: "{{ stage_dirs.task_monitor }}/m5_test_activity_preds.mscoco.json" - + # ---- R18 ---- # Object detector - file_id: 6605e0958b763ca20ae99f95 @@ -132,7 +132,7 @@ girder_file_downloads: - file_id: 66464bf9687336214e7cdeae sha512: bc7884c258cb8704372dd69a3e7d999eaf70d716d271982077c7216ef27ab01219ef1e488f6f9669e11a7e8aa6ffb9d8e07d74edc47294f90cc9e6a723f5a822 dest: "{{ stage_dirs.task_monitor }}/global_step_predictor_act_avgs_R18.npy" - + # List of git repositories to check out at a specific ref and then archive. # Destination files will be written as GZipped TAR files, so please suffix # appropriately. diff --git a/poetry.lock b/poetry.lock index b86cb85ce..3c083616d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "absl-py" @@ -3428,7 +3428,10 @@ files = [ decorator = ">=4.0.2,<5.0" imageio = {version = ">=2.5,<3.0", markers = "python_version >= \"3.4\""} imageio_ffmpeg = {version = ">=0.2.0", markers = "python_version >= \"3.4\""} -numpy = {version = ">=1.17.3", markers = "python_version > \"2.7\""} +numpy = [ + {version = ">=1.17.3", markers = "python_version != \"2.7\""}, + {version = "*", markers = "python_version >= \"2.7\""}, +] proglog = "<=1.0.0" requests = ">=2.8.1,<3.0" tqdm = ">=4.11.2,<5.0" @@ -3860,6 +3863,18 @@ files = [ {file = "numpy-1.23.5.tar.gz", hash = "sha256:1b1766d6f397c18153d40015ddfc79ddb715cabadc04d2d228d4e5a8bc4ded1a"}, ] +[[package]] +name = "nvidia-cuda-runtime-cu12" +version = "12.6.77" +description = "CUDA Runtime native Libraries" +optional = false +python-versions = ">=3" +files = [ + {file = "nvidia_cuda_runtime_cu12-12.6.77-py3-none-manylinux2014_aarch64.whl", hash = "sha256:d461264ecb429c84c8879a7153499ddc7b19b5f8d84c204307491989a365588e"}, + {file = "nvidia_cuda_runtime_cu12-12.6.77-py3-none-manylinux2014_x86_64.whl", hash = "sha256:a84d15d5e1da416dd4774cb42edf5e954a3e60cc945698dc1d5be02321c44dc8"}, + {file = "nvidia_cuda_runtime_cu12-12.6.77-py3-none-win_amd64.whl", hash = "sha256:86c58044c824bf3c173c49a2dbc7a6c8b53cb4e4dca50068be0bf64e9dab3f7f"}, +] + [[package]] name = "oauthlib" version = "3.2.2" @@ -3945,9 +3960,10 @@ files = [ [package.dependencies] numpy = [ - {version = ">=1.21.0", markers = "python_version <= \"3.9\" and platform_system == \"Darwin\" and platform_machine == \"arm64\" and python_version >= \"3.8\""}, - {version = ">=1.19.3", markers = "platform_system == \"Linux\" and platform_machine == \"aarch64\" and python_version >= \"3.8\""}, - {version = ">=1.17.3", markers = "python_version > \"3.9\" and platform_system != \"Linux\" or python_version > \"3.9\" and platform_machine != \"aarch64\" or (platform_system != \"Darwin\" and platform_system != \"Linux\") and python_version >= \"3.8\" or platform_system != \"Darwin\" and python_version >= \"3.8\" and platform_machine != \"aarch64\" or platform_machine != \"arm64\" and python_version >= \"3.8\" and platform_system != \"Linux\" or (platform_machine != \"arm64\" and platform_machine != \"aarch64\") and python_version >= \"3.8\""}, + {version = ">=1.21.0", markers = "python_version <= \"3.9\" and platform_system == \"Darwin\" and platform_machine == \"arm64\""}, + {version = ">=1.19.3", markers = "python_version >= \"3.6\" and platform_system == \"Linux\" and platform_machine == \"aarch64\""}, + {version = ">=1.17.0", markers = "python_version >= \"3.7\""}, + {version = ">=1.17.3", markers = "python_version >= \"3.8\""}, ] [[package]] @@ -6288,7 +6304,7 @@ files = [ ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} +greenlet = {version = "!=0.4.17", markers = "platform_machine == \"win32\" or platform_machine == \"WIN32\" or platform_machine == \"AMD64\" or platform_machine == \"amd64\" or platform_machine == \"x86_64\" or platform_machine == \"ppc64le\" or platform_machine == \"aarch64\""} typing-extensions = ">=4.6.0" [package.extras] @@ -6426,6 +6442,67 @@ files = [ {file = "tensorboard_data_server-0.7.2-py3-none-manylinux_2_31_x86_64.whl", hash = "sha256:ef687163c24185ae9754ed5650eb5bc4d84ff257aabdc33f0cc6f74d8ba54530"}, ] +[[package]] +name = "tensorrt" +version = "10.1.0" +description = "TensorRT Metapackage" +optional = false +python-versions = "*" +files = [ + {file = "tensorrt-10.1.0.tar.gz", hash = "sha256:5d75ef0f363f2fc38ffa1f400a441de24d6ac95f0213edeb1071c35e7210347e"}, +] + +[package.dependencies] +tensorrt-cu12 = "*" + +[[package]] +name = "tensorrt-cu12" +version = "10.1.0" +description = "A high performance deep learning inference library" +optional = false +python-versions = ">=3.6" +files = [ + {file = "tensorrt-cu12-10.1.0.tar.gz", hash = "sha256:a549e2fe472eb03b2737a708c0aef0cac9cb0be1ae46bc7dad72ec1dfc81bd19"}, +] + +[package.extras] +numpy = ["numpy"] + +[[package]] +name = "tensorrt-cu12-bindings" +version = "10.1.0" +description = "A high performance deep learning inference library" +optional = false +python-versions = "*" +files = [ + {file = "tensorrt_cu12_bindings-10.1.0-cp310-none-manylinux_2_17_x86_64.whl", hash = "sha256:91e1bd0eb348524ff209ef6b235d329983ea704b5d16f9a7ba747c08cc3c2495"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp310-none-win_amd64.whl", hash = "sha256:60b37738087d686bbefda8d5106925224e867da920bc29abeeb98eabd92c39a0"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp311-none-manylinux_2_17_x86_64.whl", hash = "sha256:9eb2ecbb403ac77161f01911284b1f3ce6b16d72992d2e2ee6f94b19dfb49732"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp311-none-win_amd64.whl", hash = "sha256:a36a51a03d56987405f6dc9496fae9bbda0bef20e5421fe428d45048687634ca"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp312-none-manylinux_2_17_x86_64.whl", hash = "sha256:46d185f7e434d97379fc0ffc5371aea8c1b92d6c927ccb57f9643191e93a174c"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp312-none-win_amd64.whl", hash = "sha256:75c7e1d022374d14e9fc15ec665f236293b7f7f17c5696c47118fa0ac00cf60c"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp38-none-manylinux_2_17_x86_64.whl", hash = "sha256:754500e42cbc20c902e3d81102413c226ba27f9b34fcfe7d710c22217c60218d"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp38-none-win_amd64.whl", hash = "sha256:3f34f0b0cf75d53e1c2891bcc6f833bb8664c43b1ac4285ba92d92bf0879a697"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp39-none-manylinux_2_17_x86_64.whl", hash = "sha256:cffcd274e68c7c6ab58a373ef42723c90a406844cd52c9830a9506f444e7b393"}, + {file = "tensorrt_cu12_bindings-10.1.0-cp39-none-win_amd64.whl", hash = "sha256:4e94137592d690c6568cc5cc92c516e4416ed9aed7991de838e43240f41e6763"}, +] + +[package.extras] +numpy = ["numpy"] + +[[package]] +name = "tensorrt-cu12-libs" +version = "10.1.0" +description = "TensorRT Libraries" +optional = false +python-versions = "*" +files = [ + {file = "tensorrt_cu12_libs-10.1.0.tar.gz", hash = "sha256:0da8d6b045d9ea9617053ad6fc09cffe459e0a554878f29114544462d516315c"}, +] + +[package.dependencies] +nvidia-cuda-runtime-cu12 = "*" + [[package]] name = "termcolor" version = "2.4.0" @@ -6461,19 +6538,6 @@ docs = ["myst-parser", "pydata-sphinx-theme", "sphinx"] test = ["pre-commit", "pytest (>=7.0)", "pytest-timeout"] typing = ["mypy (>=1.6,<2.0)", "traitlets (>=5.11.1)"] -[[package]] -name = "thop" -version = "0.1.1.post2209072238" -description = "A tool to count the FLOPs of PyTorch model." -optional = false -python-versions = "*" -files = [ - {file = "thop-0.1.1.post2209072238-py3-none-any.whl", hash = "sha256:01473c225231927d2ad718351f78ebf7cffe6af3bed464c4f1ba1ef0f7cdda27"}, -] - -[package.dependencies] -torch = "*" - [[package]] name = "threadpoolctl" version = "3.4.0" @@ -6810,17 +6874,18 @@ types-strict = ["autoflake (==1.4)", "mypy", "yapf (==0.32.0)"] [[package]] name = "ultralytics" -version = "8.1.27" -description = "Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification." +version = "8.3.9" +description = "Ultralytics YOLO for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification." optional = false python-versions = ">=3.8" files = [ - {file = "ultralytics-8.1.27-py3-none-any.whl", hash = "sha256:e5932291450d5dcba20c37c4a46ec8630d4b55c6083cc0c9d03b355c112a6b5f"}, - {file = "ultralytics-8.1.27.tar.gz", hash = "sha256:246e3b4262ab3fbfca9d570b5fd942bd6ba25ea1b8dfeda451d2187f9975c971"}, + {file = "ultralytics-8.3.9-py3-none-any.whl", hash = "sha256:26cf2e31f4f78ef995fed9b6091ab04c0b9782396cfb04b41086c84733a81c14"}, + {file = "ultralytics-8.3.9.tar.gz", hash = "sha256:89588e87b28342dde5e6c54d2b2af4754d090867f3a0e5486b7170ca215db206"}, ] [package.dependencies] matplotlib = ">=3.3.0" +numpy = ">=1.23.0" opencv-python = ">=4.6.0" pandas = ">=1.1.4" pillow = ">=7.1.2" @@ -6830,18 +6895,36 @@ pyyaml = ">=5.3.1" requests = ">=2.23.0" scipy = ">=1.4.1" seaborn = ">=0.11.0" -thop = ">=0.1.1" -torch = ">=1.8.0" +torch = [ + {version = ">=1.8.0", markers = "sys_platform != \"win32\""}, + {version = ">=1.8.0,<2.4.0 || >2.4.0", markers = "sys_platform == \"win32\""}, +] torchvision = ">=0.9.0" tqdm = ">=4.64.0" +ultralytics-thop = ">=2.0.0" [package.extras] -dev = ["check-manifest", "coverage[toml]", "ipython", "mkdocs-jupyter", "mkdocs-material (>=9.5.9)", "mkdocs-redirects", "mkdocs-ultralytics-plugin (>=0.0.44)", "mkdocstrings[python]", "pre-commit", "pytest", "pytest-cov"] +dev = ["coverage[toml]", "ipython", "mkdocs (>=1.6.0)", "mkdocs-jupyter", "mkdocs-macros-plugin (>=1.0.5)", "mkdocs-material (>=9.5.9)", "mkdocs-redirects", "mkdocs-ultralytics-plugin (>=0.1.8)", "mkdocstrings[python]", "pytest", "pytest-cov"] explorer = ["duckdb (<=0.9.2)", "lancedb", "streamlit"] -export = ["coremltools (>=7.0)", "onnx (>=1.12.0)", "openvino (>=2024.0.0)", "tensorflow (<=2.13.1)", "tensorflowjs (>=3.9.0)"] -extra = ["albumentations (>=1.0.3)", "hub-sdk (>=0.0.2)", "ipython", "pycocotools (>=2.0.7)"] +export = ["coremltools (>=7.0)", "flatbuffers (>=23.5.26,<100)", "h5py (!=3.11.0)", "keras", "numpy (==1.23.5)", "onnx (>=1.12.0)", "openvino (>=2024.0.0)", "scikit-learn (>=1.3.2)", "tensorflow (>=2.0.0)", "tensorflowjs (>=3.9.0)", "tensorstore (>=0.1.63)"] +extra = ["albumentations (>=1.4.6)", "hub-sdk (>=0.0.12)", "ipython", "pycocotools (>=2.0.7)"] logging = ["comet", "dvclive (>=2.12.0)", "tensorboard (>=2.13.0)"] +[[package]] +name = "ultralytics-thop" +version = "2.0.9" +description = "Ultralytics THOP package for fast computation of PyTorch model FLOPs and parameters." +optional = false +python-versions = ">=3.8" +files = [ + {file = "ultralytics_thop-2.0.9-py3-none-any.whl", hash = "sha256:3c3e20ce885dc6f7fa5f1f0d7ac96809c1ce3be662b892dda103d67a61243116"}, + {file = "ultralytics_thop-2.0.9.tar.gz", hash = "sha256:fd53a15c105e789d9243411fbf6efb430e4c2c42d1606d5edcd21805cc9ac78b"}, +] + +[package.dependencies] +numpy = "*" +torch = "*" + [[package]] name = "uri-template" version = "1.3.0" @@ -7433,4 +7516,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "==3.8.10" -content-hash = "6ef36222e39202b7a2ef60e0c3fb0cfaf74ab75846990d148d1fcd89a37c7c64" +content-hash = "9f29f1301db873daac79ce0c8b59d2205212beba2c424e9fcece15c9be4b7f35" diff --git a/pyproject.toml b/pyproject.toml index 392f4c56c..ec9a71fb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ timm = "^0.5.4" transitions = ">=0.8.11" trimesh = {extras = ["easy"], version = "^3.10.2"} moviepy = "==1.0.3" -ultralytics = "==8.1.27" +ultralytics = "==8.3.9" rootutils = "==1.0.7" torchmetrics = "==0.11.4" rich = "==13.7.1" @@ -48,7 +48,10 @@ mmcv = "==1.3.8" torch = {url = "https://download.pytorch.org/whl/cu111/torch-1.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl"} torchvision = {url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.1%2Bcu111-cp38-cp38-linux_x86_64.whl"} detectron2 = {url = "https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/detectron2-0.6%2Bcu111-cp38-cp38-linux_x86_64.whl"} - +tensorrt = "==10.1.0" +tensorrt-cu12 = "==10.1.0" +tensorrt-cu12-bindings = "==10.1.0" +tensorrt-cu12-libs = "==10.1.0" ## For UHO Activity Classifier ## - see arisia: /data/dawei.du/ptg-activity-recognition/activity_hydra/requirements.txt diff --git a/ros/angel_system_nodes/angel_system_nodes/object_detection/object_and_hand_detection.py b/ros/angel_system_nodes/angel_system_nodes/object_detection/object_and_hand_detection.py index c622c59c2..be18d0a78 100644 --- a/ros/angel_system_nodes/angel_system_nodes/object_detection/object_and_hand_detection.py +++ b/ros/angel_system_nodes/angel_system_nodes/object_detection/object_and_hand_detection.py @@ -136,9 +136,9 @@ def __init__(self): ########################################## # Hand model - self.hand_model = YOLOv8(self._hand_model_chpt_fp) + self.hand_model = YOLOv8(self._hand_model_chpt_fp, task="detect") log.info( - f"Loaded hand model with classes:\n" + "Loaded hand model with classes:\n" + "\n".join(f'\t- "{n}"' for n in self.hand_model.names) ) diff --git a/tmux/demos/medical/Kitware-R18.yml b/tmux/demos/medical/Kitware-R18.yml index 56796e193..05d08490c 100644 --- a/tmux/demos/medical/Kitware-R18.yml +++ b/tmux/demos/medical/Kitware-R18.yml @@ -105,7 +105,7 @@ windows: -p det_topic:=ObjectDetections2d -p object_net_checkpoint:=${MODEL_DIR}/object_detector/r18_det.pt -p inference_img_size:=768 - -p hand_net_checkpoint:=${MODEL_DIR}/object_detector/hands_model.pt + -p hand_net_checkpoint:=${MODEL_DIR}/object_detector/hands_model.engine -p cuda_device_id:=0 - activity_classifier: ros2 run angel_system_nodes activity_classifier_tcn --ros-args