diff --git a/common/vision/lasr_face_recognition/.gitignore b/common/vision/lasr_vision_deepface/.gitignore similarity index 100% rename from common/vision/lasr_face_recognition/.gitignore rename to common/vision/lasr_vision_deepface/.gitignore diff --git a/common/vision/lasr_face_recognition/CMakeLists.txt b/common/vision/lasr_vision_deepface/CMakeLists.txt similarity index 96% rename from common/vision/lasr_face_recognition/CMakeLists.txt rename to common/vision/lasr_vision_deepface/CMakeLists.txt index 65e6b0e83..b22bda630 100644 --- a/common/vision/lasr_face_recognition/CMakeLists.txt +++ b/common/vision/lasr_vision_deepface/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0.2) -project(lasr_face_recognition) +project(lasr_vision_deepface) ## Compile as C++11, supported in ROS Kinetic and newer # add_compile_options(-std=c++11) @@ -104,7 +104,7 @@ catkin_generate_virtualenv( ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( # INCLUDE_DIRS include -# LIBRARIES lasr_face_recognition +# LIBRARIES lasr_vision_deepface # CATKIN_DEPENDS rospy # DEPENDS system_lib ) @@ -122,7 +122,7 @@ include_directories( ## Declare a C++ library # add_library(${PROJECT_NAME} -# src/${PROJECT_NAME}/lasr_face_recognition.cpp +# src/${PROJECT_NAME}/lasr_vision_deepface.cpp # ) ## Add cmake target dependencies of the library @@ -133,7 +133,7 @@ include_directories( ## Declare a C++ executable ## With catkin_make all packages are built within a single CMake context ## The recommended prefix ensures that target names across packages don't collide -# add_executable(${PROJECT_NAME}_node src/lasr_face_recognition_node.cpp) +# add_executable(${PROJECT_NAME}_node src/lasr_vision_deepface_node.cpp) ## Rename C++ executable without prefix ## The above recommended prefix causes long target names, the following renames the @@ -200,7 +200,7 @@ catkin_install_python(PROGRAMS ############# ## Add gtest based cpp test target and link libraries -# catkin_add_gtest(${PROJECT_NAME}-test test/test_lasr_face_recognition.cpp) +# catkin_add_gtest(${PROJECT_NAME}-test test/test_lasr_vision_deepface.cpp) # if(TARGET ${PROJECT_NAME}-test) # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) # endif() diff --git a/common/vision/lasr_face_recognition/datasets/.gitkeep b/common/vision/lasr_vision_deepface/datasets/.gitkeep similarity index 100% rename from common/vision/lasr_face_recognition/datasets/.gitkeep rename to common/vision/lasr_vision_deepface/datasets/.gitkeep diff --git a/common/vision/lasr_face_recognition/examples/greet b/common/vision/lasr_vision_deepface/examples/greet similarity index 100% rename from common/vision/lasr_face_recognition/examples/greet rename to common/vision/lasr_vision_deepface/examples/greet diff --git a/common/vision/lasr_face_recognition/examples/relay b/common/vision/lasr_vision_deepface/examples/relay similarity index 100% rename from common/vision/lasr_face_recognition/examples/relay rename to common/vision/lasr_vision_deepface/examples/relay diff --git a/common/vision/lasr_face_recognition/launch/camera.launch b/common/vision/lasr_vision_deepface/launch/camera.launch similarity index 76% rename from common/vision/lasr_face_recognition/launch/camera.launch rename to common/vision/lasr_vision_deepface/launch/camera.launch index 0f548e569..a9c85fbb1 100644 --- a/common/vision/lasr_face_recognition/launch/camera.launch +++ b/common/vision/lasr_vision_deepface/launch/camera.launch @@ -6,7 +6,7 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/common/vision/lasr_face_recognition/launch/service.launch b/common/vision/lasr_vision_deepface/launch/service.launch similarity index 78% rename from common/vision/lasr_face_recognition/launch/service.launch rename to common/vision/lasr_vision_deepface/launch/service.launch index 60fcc1072..337c5ae88 100644 --- a/common/vision/lasr_face_recognition/launch/service.launch +++ b/common/vision/lasr_vision_deepface/launch/service.launch @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/common/vision/lasr_face_recognition/nodes/service b/common/vision/lasr_vision_deepface/nodes/service similarity index 51% rename from common/vision/lasr_face_recognition/nodes/service rename to common/vision/lasr_vision_deepface/nodes/service index 4c566fd1d..12149844c 100644 --- a/common/vision/lasr_face_recognition/nodes/service +++ b/common/vision/lasr_vision_deepface/nodes/service @@ -2,30 +2,33 @@ import re import rospy -import lasr_face_recognition as face_recognition +import lasr_vision_deepface as face_recognition from sensor_msgs.msg import Image from lasr_vision_msgs.srv import Recognise, RecogniseRequest, RecogniseResponse -rospy.init_node('recognise_service') +rospy.init_node("recognise_service") # Determine variables -DEBUG = rospy.get_param('~debug', False) +DEBUG = rospy.get_param("~debug", False) debug_publishers = {} if DEBUG: debug_publisher = rospy.Publisher("/recognise/debug", Image, queue_size=1) -def detect(request : RecogniseRequest) -> RecogniseResponse: + +def detect(request: RecogniseRequest) -> RecogniseResponse: debug_publisher = None if DEBUG: if request.dataset in debug_publishers: debug_publisher = debug_publishers[request.dataset] else: - topic_name = re.sub(r'[\W_]+', '', request.dataset) - debug_publisher = rospy.Publisher(f'/recognise/debug/{topic_name}', Image, queue_size=1) + topic_name = re.sub(r"[\W_]+", "", request.dataset) + debug_publisher = rospy.Publisher( + f"/recognise/debug/{topic_name}", Image, queue_size=1 + ) return face_recognition.detect(request, debug_publisher) -rospy.Service('/recognise', Recognise, detect) -rospy.loginfo('Face Recognition service starter') -rospy.spin() \ No newline at end of file +rospy.Service("/recognise", Recognise, detect) +rospy.loginfo("Face Recognition service starter") +rospy.spin() diff --git a/common/vision/lasr_face_recognition/package.xml b/common/vision/lasr_vision_deepface/package.xml similarity index 93% rename from common/vision/lasr_face_recognition/package.xml rename to common/vision/lasr_vision_deepface/package.xml index 1a87d55af..798e7e650 100644 --- a/common/vision/lasr_face_recognition/package.xml +++ b/common/vision/lasr_vision_deepface/package.xml @@ -1,8 +1,8 @@ - lasr_face_recognition + lasr_vision_deepface 0.0.0 - The lasr_face_recognition package + The lasr_vision_deepface package @@ -19,7 +19,7 @@ - + diff --git a/common/vision/lasr_face_recognition/requirements.in b/common/vision/lasr_vision_deepface/requirements.in similarity index 100% rename from common/vision/lasr_face_recognition/requirements.in rename to common/vision/lasr_vision_deepface/requirements.in diff --git a/common/vision/lasr_face_recognition/requirements.txt b/common/vision/lasr_vision_deepface/requirements.txt similarity index 100% rename from common/vision/lasr_face_recognition/requirements.txt rename to common/vision/lasr_vision_deepface/requirements.txt diff --git a/common/vision/lasr_face_recognition/scripts/create_dataset b/common/vision/lasr_vision_deepface/scripts/create_dataset similarity index 77% rename from common/vision/lasr_face_recognition/scripts/create_dataset rename to common/vision/lasr_vision_deepface/scripts/create_dataset index 0ab15c523..a3b502c0b 100644 --- a/common/vision/lasr_face_recognition/scripts/create_dataset +++ b/common/vision/lasr_vision_deepface/scripts/create_dataset @@ -1,10 +1,12 @@ #!/usr/bin/env python3 import sys -import lasr_face_recognition as face_recognition +import lasr_vision_deepface as face_recognition if len(sys.argv) < 3: - print("usage: rosrun lasr_face_recognition create_dataset.py [size=50]") + print( + "usage: rosrun lasr_vision_deepface create_dataset.py [size=50]" + ) exit(0) dataset = sys.argv[1] @@ -22,7 +24,9 @@ import os import cv2_img import cv2 -DATASET_ROOT = os.path.join(rospkg.RosPack().get_path("lasr_face_recognition"), "datasets") +DATASET_ROOT = os.path.join( + rospkg.RosPack().get_path("lasr_vision_deepface"), "datasets" +) DATASET_PATH = os.path.join(DATASET_ROOT, dataset, name) if not os.path.exists(DATASET_PATH): os.makedirs(DATASET_PATH) diff --git a/common/vision/lasr_face_recognition/setup.py b/common/vision/lasr_vision_deepface/setup.py similarity index 65% rename from common/vision/lasr_face_recognition/setup.py rename to common/vision/lasr_vision_deepface/setup.py index ba3e8b3fa..8fc80b9a4 100644 --- a/common/vision/lasr_face_recognition/setup.py +++ b/common/vision/lasr_vision_deepface/setup.py @@ -4,8 +4,7 @@ from catkin_pkg.python_setup import generate_distutils_setup setup_args = generate_distutils_setup( - packages=['lasr_face_recognition'], - package_dir={'': 'src'} + packages=["lasr_vision_deepface"], package_dir={"": "src"} ) -setup(**setup_args) \ No newline at end of file +setup(**setup_args) diff --git a/common/vision/lasr_face_recognition/src/lasr_face_recognition/__init__.py b/common/vision/lasr_vision_deepface/src/lasr_vision_deepface/__init__.py similarity index 100% rename from common/vision/lasr_face_recognition/src/lasr_face_recognition/__init__.py rename to common/vision/lasr_vision_deepface/src/lasr_vision_deepface/__init__.py diff --git a/common/vision/lasr_face_recognition/src/lasr_face_recognition/deepface.py b/common/vision/lasr_vision_deepface/src/lasr_vision_deepface/deepface.py similarity index 96% rename from common/vision/lasr_face_recognition/src/lasr_face_recognition/deepface.py rename to common/vision/lasr_vision_deepface/src/lasr_vision_deepface/deepface.py index 6fa062383..94c6568aa 100644 --- a/common/vision/lasr_face_recognition/src/lasr_face_recognition/deepface.py +++ b/common/vision/lasr_vision_deepface/src/lasr_vision_deepface/deepface.py @@ -10,7 +10,7 @@ from lasr_vision_msgs.srv import RecogniseRequest, RecogniseResponse DATASET_ROOT = os.path.join( - rospkg.RosPack().get_path("lasr_face_recognition"), "datasets" + rospkg.RosPack().get_path("lasr_vision_deepface"), "datasets" ) Mat = int # np.typing.NDArray[np.uint8]