diff --git a/CMakeLists.txt b/CMakeLists.txt index 06a68f4..13a131b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ set(DEPLEX_LIB_DIR ${CMAKE_BINARY_DIR}/lib) add_subdirectory(external) add_subdirectory(libs) add_subdirectory(cpp) -add_subdirectory(benchmark-artifact/cpp-benchmark) +add_subdirectory(benchmark/cpp-benchmark) if (${BUILD_EXAMPLES}) add_subdirectory(examples) endif() \ No newline at end of file diff --git a/benchmark-artifact/python-benchmark/boxplot.png b/benchmark-artifact/python-benchmark/boxplot.png deleted file mode 100644 index bbc65e5..0000000 Binary files a/benchmark-artifact/python-benchmark/boxplot.png and /dev/null differ diff --git a/benchmark-artifact/python-benchmark/create_boxplot.py b/benchmark-artifact/python-benchmark/create_boxplot.py deleted file mode 100644 index 0027f1e..0000000 --- a/benchmark-artifact/python-benchmark/create_boxplot.py +++ /dev/null @@ -1,18 +0,0 @@ -import seaborn as sns -import matplotlib.pyplot as plt -import numpy as np - -from pathlib import Path - -data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark-artifact/data" -csv_file_labels = "" # File with marked planes -def createBoxplot(): - data = np.genfromtxt(Path(data_dir) / Path('process_sequence_50_snapshot.csv'), delimiter=',') - - sns.boxplot(data=[data]) - plt.xticks([0], ['stable']) - plt.ylabel("Time (ms.)") - plt.savefig("boxplot.png", dpi=300, bbox_inches='tight') - -if __name__ == '__main__': - createBoxplot() \ No newline at end of file diff --git a/benchmark-artifact/python-benchmark/process_cloud.py b/benchmark-artifact/python-benchmark/process_cloud.py deleted file mode 100644 index 23ff43e..0000000 --- a/benchmark-artifact/python-benchmark/process_cloud.py +++ /dev/null @@ -1,51 +0,0 @@ -from deplex.utils import DepthImage -import deplex - -import open3d as o3d -import numpy as np - -from pathlib import Path - -data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark-artifact/data" -image_path = data_dir / Path("depth") / Path("000004415622.png") -config_path = data_dir / Path("config") / Path("TUM_fr3_long_val.ini") -intrinsics_path = data_dir / Path("config") / Path("intrinsics.K") -def process_cloud(): - config = deplex.Config(str(config_path)) - camera_intrinsic = np.genfromtxt(intrinsics_path) - image = DepthImage(str(image_path)) - pcd_points = image.transform_to_pcd(camera_intrinsic) - - print("Image Height:", image.height, "Image Width:", image.width) - print("Shape of PointCloud points:", pcd_points.shape) - - # Visualize PointCloud points using Open3D - - open3d_pcd = o3d.geometry.PointCloud( - o3d.utility.Vector3dVector(pcd_points) - ) - - o3d.visualization.draw_geometries([open3d_pcd]) - - coarse_algorithm = deplex.PlaneExtractor(image_height=image.height, image_width=image.width, config=config) - - labels = coarse_algorithm.process(pcd_points) - - print(f"Number of found planes: {max(labels)}") - print(np.unique(labels)) # Zero stands for non-planar point - print("Labels shape:", labels.shape) - - color_set = np.random.rand(100 + 1, 3) - pcd_colors = np.zeros(pcd_points.shape) - - non_planar_label = 0 - for color_id in np.unique(labels): - if color_id != non_planar_label: - pcd_colors[labels == color_id] = color_set[color_id] - - open3d_pcd.colors = o3d.utility.Vector3dVector(pcd_colors) - - o3d.visualization.draw_geometries([open3d_pcd]) - -if __name__ == '__main__': - process_cloud() \ No newline at end of file diff --git a/benchmark-artifact/cpp-benchmark/CMakeLists.txt b/benchmark/cpp-benchmark/CMakeLists.txt similarity index 100% rename from benchmark-artifact/cpp-benchmark/CMakeLists.txt rename to benchmark/cpp-benchmark/CMakeLists.txt diff --git a/benchmark-artifact/cpp-benchmark/benchmark_process_cloud.cpp b/benchmark/cpp-benchmark/benchmark_process_cloud.cpp similarity index 95% rename from benchmark-artifact/cpp-benchmark/benchmark_process_cloud.cpp rename to benchmark/cpp-benchmark/benchmark_process_cloud.cpp index caf8bbf..8e7aaf9 100644 --- a/benchmark-artifact/cpp-benchmark/benchmark_process_cloud.cpp +++ b/benchmark/cpp-benchmark/benchmark_process_cloud.cpp @@ -20,7 +20,7 @@ double variance(const Eigen::VectorXd& data, double mean) { int main() { std::filesystem::path data_dir = - std::filesystem::current_path().parent_path().parent_path().parent_path() / "benchmark-artifact/data"; + std::filesystem::current_path().parent_path().parent_path().parent_path() / "benchmark/data"; std::filesystem::path image_path = data_dir / "depth/000004415622.png"; std::filesystem::path intrinsics_path = data_dir / "config/intrinsics.K"; std::filesystem::path config_path = data_dir / "config/TUM_fr3_long_val.ini"; @@ -68,18 +68,6 @@ int main() { auto execution_time_segmentation_stage = algorithm.GetExecutionTime(); - for (auto& v : execution_time_segmentation_stage) { - for (auto& stage : v) { - stage /= NUMBER_OF_RUNS; - } - } - - for (auto& v : execution_time_stage) { - for (auto& stage : v) { - stage /= NUMBER_OF_RUNS; - } - } - Eigen::VectorXd elements = Eigen::VectorXd::Zero(NUMBER_OF_RUNS); for (auto i = 0; i < NUMBER_OF_RUNS; ++i) { elements[i] = execution_time_stage[i][0]; diff --git a/benchmark-artifact/cpp-benchmark/benchmark_process_sequence.cpp b/benchmark/cpp-benchmark/benchmark_process_sequence.cpp similarity index 98% rename from benchmark-artifact/cpp-benchmark/benchmark_process_sequence.cpp rename to benchmark/cpp-benchmark/benchmark_process_sequence.cpp index 17b0ad2..3c73848 100644 --- a/benchmark-artifact/cpp-benchmark/benchmark_process_sequence.cpp +++ b/benchmark/cpp-benchmark/benchmark_process_sequence.cpp @@ -20,7 +20,7 @@ double variance(const Eigen::VectorXd& data, double mean) { int main(int argc, char* argv[]) { std::filesystem::path data_dir = - std::filesystem::current_path().parent_path().parent_path().parent_path() / "benchmark-artifact/data"; + std::filesystem::current_path().parent_path().parent_path().parent_path() / "benchmark/data"; std::filesystem::path image_path = data_dir / "depth/000004415622.png"; std::filesystem::path intrinsics_path = data_dir / "config/intrinsics.K"; std::filesystem::path config_path = data_dir / "config/TUM_fr3_long_val.ini"; @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) { auto start_time = std::chrono::high_resolution_clock::now(); auto end_time = std::chrono::high_resolution_clock::now(); - const int NUMBER_OF_RUNS = 1; + const int NUMBER_OF_RUNS = 10; const int NUMBER_OF_SNAPSHOT = 1; std::vector execution_time_stage(NUMBER_OF_SNAPSHOT, Eigen::VectorXd::Zero(3)); diff --git a/benchmark-artifact/data/color/000004415600.png b/benchmark/data/color/000004415600.png similarity index 100% rename from benchmark-artifact/data/color/000004415600.png rename to benchmark/data/color/000004415600.png diff --git a/benchmark-artifact/data/config/TUM_fr3_long_val.ini b/benchmark/data/config/TUM_fr3_long_val.ini similarity index 100% rename from benchmark-artifact/data/config/TUM_fr3_long_val.ini rename to benchmark/data/config/TUM_fr3_long_val.ini diff --git a/benchmark-artifact/data/config/intrinsics.K b/benchmark/data/config/intrinsics.K similarity index 100% rename from benchmark-artifact/data/config/intrinsics.K rename to benchmark/data/config/intrinsics.K diff --git a/benchmark-artifact/data/depth/000004415622.png b/benchmark/data/depth/000004415622.png similarity index 100% rename from benchmark-artifact/data/depth/000004415622.png rename to benchmark/data/depth/000004415622.png diff --git a/benchmark-artifact/python-benchmark/benchmark_process_cloud.py b/benchmark/python-benchmark/benchmark_process_cloud.py similarity index 99% rename from benchmark-artifact/python-benchmark/benchmark_process_cloud.py rename to benchmark/python-benchmark/benchmark_process_cloud.py index d485b57..db1e1f6 100644 --- a/benchmark-artifact/python-benchmark/benchmark_process_cloud.py +++ b/benchmark/python-benchmark/benchmark_process_cloud.py @@ -6,7 +6,7 @@ from pathlib import Path -data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark-artifact/data" +data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark/data" image_path = data_dir / Path("depth") / Path("000004415622.png") config_path = data_dir / Path("config") / Path("TUM_fr3_long_val.ini") intrinsics_path = data_dir / Path("config") / Path("intrinsics.K") diff --git a/benchmark-artifact/python-benchmark/benchmark_process_sequence.py b/benchmark/python-benchmark/benchmark_process_sequence.py similarity index 99% rename from benchmark-artifact/python-benchmark/benchmark_process_sequence.py rename to benchmark/python-benchmark/benchmark_process_sequence.py index b2feecd..f706660 100644 --- a/benchmark-artifact/python-benchmark/benchmark_process_sequence.py +++ b/benchmark/python-benchmark/benchmark_process_sequence.py @@ -7,7 +7,7 @@ from pathlib import Path -data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark-artifact/data" +data_dir = Path(__file__).parent.parent.parent.resolve() / "benchmark/data" image_path = data_dir / Path("depth") / Path("000004415622.png") config_path = data_dir / Path("config") / Path("TUM_fr3_long_val.ini") intrinsics_path = data_dir / Path("config") / Path("intrinsics.K")