Skip to content

Commit 2c8a96f

Browse files
IasonTheodorouMatthijsBurgh
authored andcommitted
Feature/refactoring (#1)
2 parents a4d14d2 + 1e8ee16 commit 2c8a96f

24 files changed

+1524
-896
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
tue-ci:
7+
name: TUe CI - ${{ github.event_name }}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: TUe CI
11+
uses: tue-robotics/tue-env/ci/main@master
12+
with:
13+
package: ${{ github.event.repository.name }}

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
build/
2+
images/*
3+
onnxruntime*/
4+
onnxruntime/*
5+
docker/*
6+
CMakefile
7+
CMakeCache.txt
8+
CMakeFiles/*
9+
cmake_install.cmake
10+
Makefile
11+
SPEED-SAM-C-TENSORRT/
12+
sam_inference/model/FastSAM-x.onnx
13+
mask*
14+
segmentation_results*
15+
16+
# Models
17+
*.onnx

.vscode/c_cpp_properties_json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/include/**",
7+
"${workspaceFolder}/../hero_sam/onnxruntime-linux-x64-gpu-1.21.1/include",
8+
"/usr/local/cuda/include",
9+
"/usr/include/opencv4/**",
10+
"/opt/ros/noetic/include/**"
11+
],
12+
"defines": [
13+
14+
],
15+
"compilerPath": "/usr/bin/gcc",
16+
"cStandard": "c17",
17+
"cppStandard": "c++17",
18+
"intelliSenseMode": "linux-gcc-x64",
19+
"configurationProvider": "ms-vscode.cmake-tools"
20+
}
21+
],
22+
"version": 4
23+
}

.vscode/launch.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug SAM Model",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "/home/amigo/ros/noetic/system/devel/lib/sam_onnx_ros/test_sam_onnx_ros", // Path to the executable
9+
"args": ["/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model/SAM_encoder.onnx",
10+
"/home/amigo/Documents/repos/hero_sam.bak/sam_inference/model/SAM_mask_decoder.onnx",
11+
"/home/amigo/Documents/repos/hero_sam.bak/pipeline/build/images"], // Add any command-line arguments for your program here
12+
"stopAtEntry": false,
13+
"cwd": "${workspaceFolder}/build", // Set the working directory
14+
"environment": [],
15+
"externalConsole": false,
16+
"MIMode": "gdb",
17+
"setupCommands": [
18+
{
19+
"description": "Enable pretty-printing for gdb",
20+
"text": "-enable-pretty-printing",
21+
"ignoreFailures": true
22+
}
23+
],
24+
// "preLaunchTask": "build-sam-project" // Ensure the project is built before debugging
25+
},
26+
{
27+
"name": "Debug GTest (pick binary)",
28+
"type": "cppdbg",
29+
"request": "launch",
30+
"program": "${input:testBinary}", // pick utils_tests or sam_tests
31+
"args": [
32+
//"--gtest_filter=${input:gtestFilter}" // uncomment to filter tests
33+
],
34+
"cwd": "${workspaceFolder}", // cwd doesn’t matter if SAM_MODELS_DIR is set
35+
"environment": [
36+
{
37+
"name": "SAM_MODELS_DIR",
38+
"value": "${env:SAM_MODELS_DIR}"
39+
} // or hardcode a path here
40+
],
41+
"stopAtEntry": false,
42+
"externalConsole": false,
43+
"MIMode": "gdb",
44+
"setupCommands": [
45+
{
46+
"description": "Enable pretty-printing for gdb",
47+
"text": "-enable-pretty-printing",
48+
"ignoreFailures": true
49+
}
50+
]
51+
},
52+
{
53+
"name": "Run all tests (ctest)",
54+
"type": "cppdbg",
55+
"request": "launch",
56+
"program": "/usr/bin/ctest",
57+
"args": [
58+
"--test-dir",
59+
"/home/amigo/ros/noetic/system/build/sam_onnx_ros",
60+
"-R",
61+
"(sam_tests|utils_tests)",
62+
"--output-on-failure",
63+
"-j",
64+
"4"
65+
],
66+
"cwd": "/home/amigo/ros/noetic/system/build/sam_onnx_ros",
67+
"environment": [
68+
{
69+
"name": "SAM_MODELS_DIR",
70+
"value": "${env:SAM_MODELS_DIR}"
71+
}
72+
],
73+
"stopAtEntry": false,
74+
"externalConsole": false,
75+
"MIMode": "gdb"
76+
// Note: ctest launching isn't great for step-debugging individual tests.
77+
}
78+
],
79+
"inputs": [
80+
{
81+
"id": "testBinary",
82+
"type": "pickString",
83+
"description": "Select gtest executable",
84+
"options": [
85+
"/home/amigo/ros/noetic/system/devel/.private/sam_onnx_ros/lib/sam_onnx_ros/utils_tests",
86+
"/home/amigo/ros/noetic/system/devel/.private/sam_onnx_ros/lib/sam_onnx_ros/sam_tests"
87+
]
88+
},
89+
{
90+
"id": "gtestFilter",
91+
"type": "promptString",
92+
"description": "gtest filter (e.g. Utils* or SamInferenceTest.PreProcess*)",
93+
"default": "*"
94+
}
95+
],
96+
}

.vscode/settings.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"files.associations": {
3+
"iostream": "cpp",
4+
"cctype": "cpp",
5+
"clocale": "cpp",
6+
"cmath": "cpp",
7+
"cstdarg": "cpp",
8+
"cstddef": "cpp",
9+
"cstdio": "cpp",
10+
"cstdlib": "cpp",
11+
"cstring": "cpp",
12+
"ctime": "cpp",
13+
"cwchar": "cpp",
14+
"cwctype": "cpp",
15+
"array": "cpp",
16+
"atomic": "cpp",
17+
"strstream": "cpp",
18+
"bit": "cpp",
19+
"*.tcc": "cpp",
20+
"bitset": "cpp",
21+
"chrono": "cpp",
22+
"codecvt": "cpp",
23+
"complex": "cpp",
24+
"condition_variable": "cpp",
25+
"cstdint": "cpp",
26+
"deque": "cpp",
27+
"list": "cpp",
28+
"map": "cpp",
29+
"set": "cpp",
30+
"unordered_map": "cpp",
31+
"unordered_set": "cpp",
32+
"vector": "cpp",
33+
"exception": "cpp",
34+
"algorithm": "cpp",
35+
"functional": "cpp",
36+
"iterator": "cpp",
37+
"memory": "cpp",
38+
"memory_resource": "cpp",
39+
"numeric": "cpp",
40+
"optional": "cpp",
41+
"random": "cpp",
42+
"ratio": "cpp",
43+
"regex": "cpp",
44+
"string": "cpp",
45+
"string_view": "cpp",
46+
"system_error": "cpp",
47+
"tuple": "cpp",
48+
"type_traits": "cpp",
49+
"utility": "cpp",
50+
"fstream": "cpp",
51+
"initializer_list": "cpp",
52+
"iomanip": "cpp",
53+
"iosfwd": "cpp",
54+
"istream": "cpp",
55+
"limits": "cpp",
56+
"mutex": "cpp",
57+
"new": "cpp",
58+
"ostream": "cpp",
59+
"shared_mutex": "cpp",
60+
"sstream": "cpp",
61+
"stdexcept": "cpp",
62+
"streambuf": "cpp",
63+
"thread": "cpp",
64+
"cfenv": "cpp",
65+
"cinttypes": "cpp",
66+
"typeindex": "cpp",
67+
"typeinfo": "cpp",
68+
"variant": "cpp",
69+
"compare": "cpp",
70+
"concepts": "cpp",
71+
"numbers": "cpp",
72+
"semaphore": "cpp",
73+
"stop_token": "cpp",
74+
"*.txx": "cpp",
75+
"filesystem": "cpp"
76+
}
77+
}

.vscode/tasks.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build-sam-project",
6+
"dependsOrder": "sequence",
7+
"dependsOn": ["configure-sam", "build-sam-binary"],
8+
"problemMatcher": ["$gcc"],
9+
"group": "build"
10+
},
11+
{
12+
"label": "configure-sam",
13+
"type": "shell",
14+
"command": "cmake",
15+
"args": [
16+
"-DCMAKE_BUILD_TYPE=Debug",
17+
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
18+
"-S", "${workspaceFolder}/",
19+
"-B", "${workspaceFolder}/build"
20+
],
21+
"problemMatcher": ["$gcc"]
22+
},
23+
{
24+
"label": "build-sam-binary",
25+
"type": "shell",
26+
"command": "cmake",
27+
"args": [
28+
"--build",
29+
"${workspaceFolder}/build",
30+
"--config", "Debug"
31+
],
32+
"problemMatcher": ["$gcc"]
33+
},
34+
35+
]
36+
}

0 commit comments

Comments
 (0)