-
Notifications
You must be signed in to change notification settings - Fork 6
2D->3D detection to pointcloud new pipeline #94
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
Open
IasonTheodorou
wants to merge
41
commits into
master
Choose a base branch
from
python_playground
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
6e7d5f4
Add python playground pkg
MatthijsBurgh 96a8ce2
added onnx yolo c++ implementation for object classification
IasonTheodorou 2ccc003
Updated Cmake to find the onnx file
IasonTheodorou 4782ec0
Disable CUDA and include absolute path to the model
IasonTheodorou 7a72f40
calling ClassificaitionINference functio
IasonTheodorou 9844303
Added the new YOLO and SAM implementation
IasonTheodorou 970078f
Added visualization on a rostopic for debugging
IasonTheodorou 4252c39
Add new segmented implementation on the pipeline
IasonTheodorou d117ba6
Segment and display on rqt the results
IasonTheodorou 6f62a5a
Added rgb preprocessing by appliying the depth preprocessed filter fo…
IasonTheodorou bf03804
Added new visualization
IasonTheodorou 913d02a
Added some more filtering (a statistical one to remove outliers in th…
IasonTheodorou d1c8fab
Added debug statements and publish pointcloud (still not fully working)
IasonTheodorou 37eda3d
Publish the pointcloud as a ROS topic for visual inspection of the pr…
IasonTheodorou aae3dab
Added new filtering for point cloud estimation
IasonTheodorou ef905cd
Better visualization on rqt
IasonTheodorou f84f153
Applied GMM and DBSCAN to clean the pointcloud noise
IasonTheodorou 5264017
Implemented Bayesian GMM for having also priors on the model
IasonTheodorou 9fe979d
Kept GMM with no-prior enabled
IasonTheodorou 0af0aaf
Added ros parames to tune all the priors of the bayesian GMM
IasonTheodorou 046e257
Added ros parames small fix to compile
IasonTheodorou cd350be
Implemented GMM with parameters for fast turning (without compile)
IasonTheodorou 0342e9e
Select the inlier based on argmax responsibility and not based on geo…
IasonTheodorou 5730d57
Update non-bayesian GMM to perform hard-clustering based on responsib…
IasonTheodorou 23d5d85
Added also a fully variational inference engine for bayesian GMM (now…
IasonTheodorou 6d52901
Add rosparameters for dbscan as well
IasonTheodorou 540ee56
Removed custom simple statistical filter (kept only GMM)
IasonTheodorou 8c50423
Model the outliers as uniform distribution
IasonTheodorou 6aadaab
Used SAM and BMM models from ros packages instead of bad way (still n…
IasonTheodorou df14783
Made ed_sensor_integration use only the new ros packages (yolo-sam-bm…
IasonTheodorou b15d832
Removed all visualization function from updater and included it into …
IasonTheodorou 8f82ba0
Included the old behavior now with segmenter_ object as a pointer
IasonTheodorou f77fc9c
Updating CMakeLists and small refactoring/fixes
IasonTheodorou 61fe7e4
Changed function naming to proper match as part of the refactoring
IasonTheodorou 08658a0
added doxygen description for the new functions
IasonTheodorou d103982
removed hardcoded values (added variables for them) and removed some …
IasonTheodorou 58f4df7
commented out simple statistical outlier removal since GMM is much st…
IasonTheodorou 70aa2ad
made indexing of the CV mat more robust since before it was treated a…
IasonTheodorou 7a2532c
impoved ROS error logging
IasonTheodorou 7a5dff6
added sam correct header paths
IasonTheodorou cbbf10a
updated CMake and small things to support onnx_runtime package
IasonTheodorou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,29 @@ | ||||||||
| cmake_minimum_required(VERSION 3.0.2) | ||||||||
| cmake_minimum_required(VERSION 3.5) | ||||||||
| project(ed_sensor_integration) | ||||||||
|
|
||||||||
| add_compile_options(-Wall -Werror=all) | ||||||||
| add_compile_options(-Wextra -Werror=extra) | ||||||||
|
|
||||||||
| #add_compile_options(-Wall -Werror=all) | ||||||||
| #add_compile_options(-Wextra -Werror=extra) | ||||||||
|
|
||||||||
| # # -------------- ONNXRuntime Setup (define this early) ------------------# | ||||||||
| # set(ONNXRUNTIME_VERSION 1.21.1) | ||||||||
| # set(ONNXRUNTIME_ROOT "/home/amigo/Documents/repos/hero_sam.bak/onnxruntime-linux-x64-gpu-${ONNXRUNTIME_VERSION}") | ||||||||
|
|
||||||||
| # -------------- Neural Network Models ------------------# | ||||||||
|
|
||||||||
| # Copy model files to the same folder as the executables | ||||||||
| #configure_file(/home/amigo/Documents/repos/hero_sam.bak/yolo_inference/data/coco.yaml ${CATKIN_DEVEL_PREFIX}/lib/ed_sensor_integration/coco.yaml COPYONLY) | ||||||||
| #configure_file(/home/amigo/Documents/repos/hero_sam.bak/yolo_inference/model/yolo11m.onnx ${CATKIN_DEVEL_PREFIX}/lib/ed_sensor_integration/yolo11m.onnx COPYONLY) | ||||||||
| # configure_file(/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model/SAM_mask_decoder.onnx ${CATKIN_DEVEL_PREFIX}/lib/ed_sensor_integration/SAM_mask_decoder.onnx COPYONLY) | ||||||||
| # configure_file(/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model/SAM_encoder.onnx ${CATKIN_DEVEL_PREFIX}/lib/ed_sensor_integration/SAM_encoder.onnx COPYONLY) | ||||||||
| #OR | ||||||||
| # Define model paths | ||||||||
| set(YOLO_MODELS_PATH "/home/amigo/Documents/repos/hero_sam.bak/yolo_inference/model") | ||||||||
| set(SAM_MODELS_PATH "/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model") | ||||||||
|
||||||||
| set(SAM_MODELS_PATH "/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model") | |
| # Set the path to the SAM model files. Override with -DSAM_MODELS_PATH=/your/path when running cmake. | |
| set(SAM_MODELS_PATH "" CACHE PATH "Path to the SAM model files") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
ed_sensor_integration/include/ed_sensor_integration/kinect/segmodules/sam_seg_module.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| #pragma once | ||
|
|
||
| #include <ros/ros.h> | ||
| #include "yolo_onnx_ros/yolo_inference.hpp" | ||
| #include "sam_onnx_ros/sam_inference.hpp" | ||
| #include <sensor_msgs/Image.h> | ||
| #include <sensor_msgs/PointCloud2.h> | ||
| #include <opencv2/core.hpp> | ||
| //#include "ed/kinect/entity_update.h" | ||
| #include <cv_bridge/cv_bridge.h> | ||
| #include <geolib/sensors/DepthCamera.h> | ||
| #include <geolib/Shape.h> | ||
| #include <pcl/point_types.h> | ||
| #include <pcl/point_cloud.h> | ||
| #include <pcl/segmentation/extract_clusters.h> | ||
| #include <pcl_conversions/pcl_conversions.h> | ||
| #include <sensor_msgs/Image.h> | ||
| #include <sensor_msgs/PointCloud2.h> | ||
|
|
||
| // EntityUpdate and UpdateResult come from kinect (avoid including laser variant to prevent redefinition) | ||
| #include <ed/kinect/entity_update.h> | ||
| #include <ed/kinect/segmenter.h> // defines UpdateResult (and possibly other needed types) | ||
|
|
||
| /** | ||
| * @brief Segmentation pipeline that processes the input image and generates segmentation masks. | ||
| * | ||
| * @param img The input RGB image to segment. | ||
| * @return std::vector<cv::Mat> The generated segmentation masks. | ||
| */ | ||
| std::vector<cv::Mat> SegmentationPipeline(const cv::Mat& img); | ||
|
|
||
| /** | ||
| * @brief Overlay segmentation masks on the RGB image for visualization purposes. | ||
| * | ||
| * @param rgb The RGB image to overlay masks on. | ||
| * @param masks The segmentation masks to overlay. | ||
| */ | ||
| void overlayMasksOnImage_(cv::Mat& rgb, const std::vector<cv::Mat>& masks); | ||
|
|
||
| /** | ||
| * @brief Publish segmentation results and pointcloud estimation as ROS messages. | ||
| * | ||
| * @param filtered_depth_image The filtered depth image to publish. | ||
| * @param rgb The RGB image to publish. | ||
| * @param sensor_pose The pose of the sensor. | ||
| * @param clustered_images The clustered segmentation masks. | ||
| * @param mask_pub_ The ROS publisher for the mask images. | ||
| * @param cloud_pub_ The ROS publisher for the point cloud data. | ||
| * @param res_updates The entity updates to publish. | ||
| */ | ||
| void publishSegmentationResults(const cv::Mat& filtered_depth_image, const cv::Mat& rgb, | ||
| const geo::Pose3D& sensor_pose, std::vector<cv::Mat>& clustered_images, | ||
| ros::Publisher& mask_pub_, ros::Publisher& cloud_pub_, std::vector<EntityUpdate>& res_updates); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded absolute paths make the build non-portable. These paths should be configurable through environment variables or CMake cache variables, e.g.,
set(ONNXRUNTIME_ROOT $ENV{ONNXRUNTIME_ROOT} CACHE PATH \"Path to ONNX Runtime\").