Skip to content
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

Receptionist recognise and look at #220

Merged
merged 262 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
22b6a2f
chore: update receptionist demo.
jws-1 Nov 14, 2023
733eb1d
feat: look for chair and seat guest.
jws-1 Nov 14, 2023
ccea709
WIP: get guest name.
jws-1 Nov 14, 2023
93e1345
feat: be more informative.
jws-1 Nov 14, 2023
831a0f3
fix: set unknown.
jws-1 Nov 14, 2023
1c8d013
feat: announce name as well as drink.
jws-1 Nov 14, 2023
6d4e8fb
refactor: ignore point.
jws-1 Nov 14, 2023
73a1a34
feat: be more explicit; look at the chair and semantically describe i…
jws-1 Nov 14, 2023
a3ea0ec
WIP.
jws-1 Nov 16, 2023
4e6d03f
feat: add option to specify device to use for whisper.
jws-1 Nov 17, 2023
a2d4704
feat: simple transcribe microphone service.
jws-1 Nov 17, 2023
f3290dd
refactor: make transcribe and parse service use the new 'simple' tran…
jws-1 Nov 17, 2023
1392b82
feat: terminate audio interface.
jws-1 Nov 17, 2023
18cfb26
chore: update CMakeLists.
jws-1 Nov 17, 2023
603de9c
refactor: acquire microphone when initialising service.
jws-1 Nov 17, 2023
de5ed26
chore: update launch file.
jws-1 Nov 17, 2023
02705b0
fix: remove call to redundant method,
jws-1 Nov 17, 2023
3180338
fix: error handling.
jws-1 Nov 17, 2023
d197ec7
feat/fix: pre-load whisper model by prompting it, adjust for ambient …
jws-1 Nov 17, 2023
3603822
chore: configuration required for deploying docs
insertish Nov 6, 2023
6451cbf
docs: update container documentation
insertish Nov 11, 2023
9e3a941
ci: first draft of documentation build through actions
insertish Nov 11, 2023
a991065
ci: remove submodules
insertish Nov 11, 2023
2a845d0
ci: use ubuntu 20.04
insertish Nov 11, 2023
175adb7
ci: try using ros:noetic container image
insertish Nov 11, 2023
969c892
ci: catkin tools isn't available in container
insertish Nov 11, 2023
c224356
ci: remove extranous source line
insertish Nov 11, 2023
a0e1241
ci: try the one-liner ROS installer
insertish Nov 11, 2023
89f16f4
ci: use the official ROS noetic installation guide
insertish Nov 11, 2023
0228253
ci: install catkin tools
insertish Nov 11, 2023
26e9544
ci: try sourcing before commands
insertish Nov 11, 2023
0b34222
ci: deploy to github pages (no stage check yet)
insertish Nov 11, 2023
ad371ea
ci: use deploy key
insertish Nov 11, 2023
ccee21a
ci: only deploy if on main
insertish Nov 11, 2023
63e6a95
chore: update receptionist data and pipeline.
jws-1 Nov 21, 2023
cf12176
fix: explicitly set spacy NLP model.
jws-1 Nov 21, 2023
4407513
fix: drop age for now, since spacy is broken(?).
jws-1 Nov 21, 2023
984d212
feat: point and raise_torso motions.
jws-1 Nov 21, 2023
f65760a
feat: point to chair.
jws-1 Nov 21, 2023
5a80d81
feat: additional motions.
jws-1 Nov 21, 2023
000b9d7
fix: reset motions.
jws-1 Nov 21, 2023
251cf30
fix: handle empty transcriptions.
jws-1 Nov 21, 2023
7e66eb0
fix: enable start state.
jws-1 Nov 21, 2023
8d3cd73
fix: properly reset motions
jws-1 Nov 21, 2023
5d8e45f
fix(ci): use github_token for gh pages deploy.
jws-1 Nov 25, 2023
9f2406f
revert: fix(ci): use github_token for gh pages deploy.
jws-1 Nov 25, 2023
8915cc0
feat: save microphone output to audio files
m-barker Nov 27, 2023
706b7d6
chore: update gitignore with python setup files
m-barker Dec 1, 2023
0d7e7dd
fix: filename typo and add to cmake
m-barker Dec 1, 2023
0751e37
testtesttest
Dec 5, 2023
a8f97ce
Test
Dec 5, 2023
5fe6a93
Test
Dec 5, 2023
768ad46
Message Change
Dec 6, 2023
a807b48
Merge pull request #1 from MBTMBTMBT/12_6
MBTMBTMBT Dec 6, 2023
6452c1d
fixed message writting and reading
Dec 7, 2023
5818b5e
fixed image crop
Dec 7, 2023
4ed5176
Updated the feature extraction node and changed the messages.
Dec 7, 2023
d4581c7
Merge pull request #2 from MBTMBTMBT/12_6
MBTMBTMBT Dec 7, 2023
7e3c7af
fixed that torsal and head frames were inversed.
Dec 8, 2023
4fa8ced
Merge pull request #3 from MBTMBTMBT/12_6
MBTMBTMBT Dec 8, 2023
2d88e78
Changed colour format from BGR to RGB within the detection process.
Dec 8, 2023
d4ba82c
keep the saved model
Dec 8, 2023
8f29414
keep the model file
Dec 8, 2023
8291007
keep the saved model
Dec 8, 2023
5654c3c
Cancel saving the images (but sitll cannot see use cv2.imshow)
Dec 8, 2023
9bca082
Runnable demo
Dec 11, 2023
5b034f6
added the hair colour distribution matching method
Dec 13, 2023
e19e9df
retrained model is very robust so changed the threshold
Dec 14, 2023
9343487
Moving the head to meet the person.
Jan 31, 2024
98535a0
xyz axis readable.
Feb 2, 2024
ecd469e
(Hopefully) Runnable with 3d input.
Feb 5, 2024
a4bfa70
Speak normally.
Feb 5, 2024
2a1e8d7
Try to move the head.
Feb 5, 2024
684d51b
testtesttest
Dec 5, 2023
d0c27e2
Test
Dec 5, 2023
4903409
Test
Dec 5, 2023
0dfc09a
Message Change
Dec 6, 2023
f9743ae
fixed message writting and reading
Dec 7, 2023
47ebc7c
fixed image crop
Dec 7, 2023
e8b2012
Updated the feature extraction node and changed the messages.
Dec 7, 2023
77feadb
fixed that torsal and head frames were inversed.
Dec 8, 2023
c096166
Changed colour format from BGR to RGB within the detection process.
Dec 8, 2023
67804ec
keep the saved model
Dec 8, 2023
cc860ac
keep the model file
Dec 8, 2023
8f54363
keep the saved model
Dec 8, 2023
7827dc2
Cancel saving the images (but sitll cannot see use cv2.imshow)
Dec 8, 2023
134c870
Runnable demo
Dec 11, 2023
3c6743f
added the hair colour distribution matching method
Dec 13, 2023
c1b50a5
retrained model is very robust so changed the threshold
Dec 14, 2023
2ed42a4
Moving the head to meet the person.
Jan 31, 2024
6282d2d
xyz axis readable.
Feb 2, 2024
a15a9d9
(Hopefully) Runnable with 3d input.
Feb 5, 2024
29060c0
ah
Feb 5, 2024
ef0a5f1
At least the head moves, not looking at me though.
Feb 8, 2024
205b52e
Merge branch 'LASR-at-Home:main' into main
MBTMBTMBT Feb 18, 2024
86e7a3e
Cleaned the file to have only one model appear.
Feb 23, 2024
3e384d1
Replace the old model with the new one.
Feb 23, 2024
1cb2e3b
merging
Feb 23, 2024
d66fcb3
correct the lost module.
Feb 23, 2024
aa8ec6e
info update
Feb 23, 2024
c65ccd1
fixed issues in the service
Feb 23, 2024
af28931
fixed a stupic typo
Feb 23, 2024
b91b736
runnable version for full demo
Feb 23, 2024
ae3975c
Merge branch 'main' into update-model
MBTMBTMBT Feb 23, 2024
4f78c7e
Merge pull request #4 from MBTMBTMBT/update-model
MBTMBTMBT Feb 23, 2024
d4a677a
Recover the state machine for demo.
Feb 23, 2024
7d1d84b
Added a simple loop to refresh the frame taken, should work fine.
Feb 27, 2024
91654ef
fix merge issues
zoe013evans Mar 1, 2024
8c53140
merging bens fork into my fork
zoe013evans Mar 1, 2024
7a8fb29
adding learn_face
zoe013evans Mar 1, 2024
88da39e
adding detect faces
zoe013evans Mar 1, 2024
92eef7e
Add detect faces state
M-Aaliyah Mar 1, 2024
70d893c
editing detect phases
zoe013evans Mar 1, 2024
74af0f6
merging detect faces changes
zoe013evans Mar 1, 2024
0229a35
Implement state for learning faces
haiwei-luo Mar 1, 2024
2e0fa81
adding in extra states
zoe013evans Mar 1, 2024
9694429
Merge remote-tracking branch 'haiwei_branch/main'
zoe013evans Mar 1, 2024
74f34f8
any changes
zoe013evans Mar 4, 2024
21e5b2d
adjustments when testing
Mar 8, 2024
191fbca
push lol
haiwei-luo Mar 11, 2024
81b4729
trying to merge
zoe013evans Mar 22, 2024
e53616d
finished merging?
zoe013evans Mar 22, 2024
8860b1a
new state machine
zoe013evans Mar 22, 2024
5f367b8
Merge branch 'main' of https://github.com/zoe013evans/base_zoe_fork i…
Mar 22, 2024
41b0bb5
merging from rexy laptop
Mar 22, 2024
9a005cf
fixed detect faces
Mar 22, 2024
e4bf5a2
getting rid of lasr_speech
Mar 26, 2024
9a38113
swapping from base controllers to skills
Mar 26, 2024
b8f7bdb
fixing state machine after merge with main
Mar 27, 2024
dea1417
making changes
zoe013evans Mar 27, 2024
8ee0228
Merge remote-tracking branch 'base/main' into receptionist
jws-1 Apr 11, 2024
4001a10
TEST: .idea diff
m-barker Apr 11, 2024
f48ba89
feat: get name and drink skill & prior data yaml
m-barker Apr 11, 2024
f3c4a07
fix: missing keys for get name & drink constructor
m-barker Apr 11, 2024
2bc32ed
feat: stubs for get attribute state
m-barker Apr 11, 2024
232a3ab
feat: wrap head manager and lowering base into GoToLocation.
jws-1 Apr 11, 2024
2191420
feat: state machine setup.
jws-1 Apr 11, 2024
091f179
Merge remote-tracking branch 'base/main' into HEAD
jws-1 Apr 11, 2024
4389f62
test: Github tracking fixes
m-barker Apr 11, 2024
0e6e9cb
feat: allow AskAndListen to take static text, a format string or reda…
jws-1 Apr 11, 2024
09b0c13
refactor: being picky about spaces.
jws-1 Apr 11, 2024
d6e9929
fix: import states in dunder init.
jws-1 Apr 11, 2024
ca58f85
feat: get name and drink, and stub for attributes.
jws-1 Apr 11, 2024
963ac72
fix: typehint for userdata
m-barker Apr 11, 2024
5367e21
Merge branch 'receptionist' of github.com:LASR-at-Home/Base into rece…
m-barker Apr 11, 2024
3461dd5
feat: setup host.
jws-1 Apr 11, 2024
0780a3e
fix: typehint.
jws-1 Apr 11, 2024
fc01e09
fix: refactor ParseNameAndDrink state to convert possible names and d…
m-barker Apr 11, 2024
6552389
Merge branch 'receptionist' of github.com:LASR-at-Home/Base into rece…
m-barker Apr 11, 2024
7f92b16
refactor: receptionist -> sm_merge (conflicts with python package...)
jws-1 Apr 11, 2024
8cc2f3e
refactor: remove redundant __init__.py
jws-1 Apr 11, 2024
3cf1b8e
fix: container consistency.
jws-1 Apr 11, 2024
17a7972
fix: initialise data correctly.
jws-1 Apr 11, 2024
474b983
fix: lower.
jws-1 Apr 11, 2024
4627fd4
fix: uncomment.
jws-1 Apr 11, 2024
6d01ad2
feat: take seating area pose and polygon as input to sm.
jws-1 Apr 11, 2024
784d116
feat: guide guest to seating area.
jws-1 Apr 11, 2024
fe8d550
feat: add introduce state
m-barker Apr 11, 2024
955fc05
Merge branch 'receptionist' of github.com:LASR-at-Home/Base into rece…
m-barker Apr 11, 2024
619b079
feat: add introduction to state machine
m-barker Apr 11, 2024
9b9af25
feat(WIP): find empty seat.
jws-1 Apr 11, 2024
43b04b8
fix: sneaky parenthesis stops boolifying.
jws-1 Apr 11, 2024
d784222
fix: correctly access guest attribute data
m-barker Apr 11, 2024
5398c15
Merge branch 'receptionist' of github.com:LASR-at-Home/Base into rece…
m-barker Apr 11, 2024
bc1e64e
fix: get introduce working.
jws-1 Apr 11, 2024
cb52764
feat(WIP, still): find an empty seat.
jws-1 Apr 14, 2024
697ff98
feat/refactor: SeatGuest is working and rename.
jws-1 Apr 16, 2024
9d09697
feat: update init.py
jws-1 Apr 16, 2024
290b2c4
refactor: static motions.
jws-1 Apr 16, 2024
d9599fe
feat: seat guest in state machine.
jws-1 Apr 16, 2024
319de4a
feat: send head back to default.
jws-1 Apr 16, 2024
36e323d
refactor: center -> centre.
jws-1 Apr 16, 2024
9976d2b
feat: logic for second guest and pass guest id through constructors.
jws-1 Apr 16, 2024
002cf88
fix: transition.
jws-1 Apr 16, 2024
68e03d0
refactor: drop unused method.
jws-1 Apr 16, 2024
2c3bac2
Remove print statement and add TODO.
jws-1 Apr 16, 2024
17efbc6
fix: namespace.
jws-1 Apr 16, 2024
3723d26
fix: transition and assume PlayMotion succeeded.
jws-1 Apr 16, 2024
40d60dc
test: yaml setup for testing.
jws-1 Apr 16, 2024
3929354
fix: transitions.
jws-1 Apr 16, 2024
8184b41
refactor: remove redundant comment.
jws-1 Apr 16, 2024
fdd0928
fix: dumb intersection bug.
jws-1 Apr 16, 2024
bffc91b
feat: clip skill for VQA
m-barker Apr 16, 2024
c707ee4
Merge branch 'receptionist' of github.com:LASR-at-Home/Base into rece…
m-barker Apr 16, 2024
6b5a622
feat: attempt of clip for attributes
m-barker Apr 16, 2024
1603c63
fix: missing imports
m-barker Apr 16, 2024
4d41cb3
feat: tidied clip attributes
m-barker Apr 18, 2024
df97d21
refactor: cleanup.
jws-1 Apr 18, 2024
65820f3
refactor: cleanup again.
jws-1 Apr 18, 2024
5525cc0
refactor: massive cleanup.
jws-1 Apr 18, 2024
5922f50
refactor: remove hair colour images.
jws-1 Apr 18, 2024
56711d3
refactor: cleanup cv2_img.
jws-1 Apr 18, 2024
e619fc9
refactor: move Vqa service message into lasr_vision_msgs.
jws-1 Apr 18, 2024
54b6965
fix: import.
jws-1 Apr 18, 2024
8c6373d
cleanup: remove vision changes.
jws-1 Apr 18, 2024
26e4db1
refactor: cleanup clip vqa skill.
jws-1 Apr 18, 2024
aa1d956
refactor: cleanup describe people skill.
jws-1 Apr 18, 2024
21e6991
refactor: cleanup vision msgs.
jws-1 Apr 18, 2024
b7a7368
refactor: remove shebang and unused import.
jws-1 Apr 18, 2024
025075f
refactor: remove unnecessary message.
jws-1 Apr 18, 2024
412df05
refactor: make QueryImage a ServiceState.
jws-1 Apr 18, 2024
5fd70fe
refactor: make QueryImage a ServiceState.
jws-1 Apr 18, 2024
755952b
build: CMake and requirements.
jws-1 Apr 18, 2024
2de5672
Merge branch 'main' into receptionist
jws-1 Apr 18, 2024
99d8e00
feat: fix the msgs for bodypix
fireblonde Apr 23, 2024
6112a77
feat: test initial segment person
fireblonde Apr 23, 2024
695e2a7
feat: filter the poses liek the masks
fireblonde Apr 23, 2024
ee700ee
feat: filter the poses liek the masks
fireblonde Apr 23, 2024
9f3b2a5
chore: add pcl to img msg and keep the same timestampt
fireblonde Apr 23, 2024
fe0a88c
chore: change the look to point to use pointstamp instead
fireblonde Apr 23, 2024
4217b37
chore: add the 3d image skill
fireblonde Apr 23, 2024
4f77924
feat: working look at person
fireblonde Apr 23, 2024
e0a8fbf
chore: cleanup for PR
fireblonde Apr 23, 2024
5a77462
Merge branch 'main' into receptionist-look-at-person
jws-1 Apr 23, 2024
dc149bf
Merge branch 'main' into receptionist-look-at-person
jws-1 May 9, 2024
69d1813
fix: the PR comments + add head manager disable/enable
fireblonde May 10, 2024
0da0df2
feat: wip
fireblonde May 13, 2024
bb61f20
feat: working wip
fireblonde May 13, 2024
680cca7
feat: look at multiple people working
fireblonde May 13, 2024
f940aa8
chore: prep for PR
fireblonde May 19, 2024
20707a1
chore: initial plan
fireblonde May 19, 2024
0d3c30e
feat: add learn face skill
fireblonde May 19, 2024
cacc883
feat: add check known people
fireblonde May 19, 2024
53840c9
feat: initial recognise srv sttae
fireblonde May 22, 2024
95baf48
feat: test with host
fireblonde May 22, 2024
3cb4c86
feat: fix if no deepface recognitions
fireblonde May 22, 2024
c8416d4
feat: test without filter
fireblonde May 22, 2024
77e8bf9
feat: finally find the rigth param for head
fireblonde May 22, 2024
003e343
feat: add the sweep positions
fireblonde May 24, 2024
4670a30
feat: add test file for find and look state
fireblonde May 26, 2024
9aabf71
feat: add test file for look at person
fireblonde May 26, 2024
52ec89a
feat: cleanup the look at skill and receptionist state
fireblonde May 26, 2024
7f90293
chore: some minor fixes here and there for receptionist
fireblonde May 26, 2024
c89334c
feat: find named person andlearn face
fireblonde May 26, 2024
941df1b
chore: remove guest name in class vars
fireblonde May 26, 2024
345a182
feat: tested on the robot
fireblonde May 26, 2024
fad13f4
chore: sort merge conflicts
fireblonde Jun 14, 2024
cf4df99
Merge remote-tracking branch 'base/main' into HEAD
fireblonde Jun 14, 2024
4ae2ef6
chopre: reformatting for pr
fireblonde Jun 14, 2024
c8ffb40
chopre: reformatting for pr
fireblonde Jun 14, 2024
34c65f1
chore: prep for pr and test on robot again
fireblonde Jun 16, 2024
967d977
chore: prep for pr and test on robot again
fireblonde Jun 16, 2024
37f8b3f
chore: formatttttt
fireblonde Jun 16, 2024
5634052
chore: formatttttt
fireblonde Jun 16, 2024
03fb352
chore: formatttttt
fireblonde Jun 16, 2024
5e4bc9b
chore: final reformat
fireblonde Jun 16, 2024
03a2ee5
Merge remote-tracking branch 'base/main' into HEAD
fireblonde Jun 16, 2024
a50cc67
feat: add service instead of state
fireblonde Jun 19, 2024
dc2df31
chiore: address pr review
fireblonde Jun 19, 2024
aba3fef
chore: address comments from pr
fireblonde Jun 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def run_clip(
Returns:
List[float]: the cosine similarity scores between the image and label embeddings.
"""

txt = model.encode(labels)
img = model.encode(img)
with torch.no_grad():
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python3

import rospy
from lasr_vision_msgs.srv import CheckKnownPeopleRequest, CheckKnownPeopleResponse, CheckKnownPeople

if __name__ == "__main__":

# get the known people from the service
rospy.wait_for_service("/check_known_people")
check_known_people = rospy.ServiceProxy("/check_known_people", CheckKnownPeople)
response = check_known_people("receptionist")
print(response.known_people)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3

import rospy
import os
import rospkg
from lasr_vision_msgs.srv import CheckKnownPeopleRequest, CheckKnownPeopleResponse, CheckKnownPeople

DATASET_ROOT = os.path.join(
rospkg.RosPack().get_path("lasr_vision_deepface"), "datasets"
)

rospy.init_node("check_known_people_service")

def check_known_people(request : CheckKnownPeopleRequest) -> CheckKnownPeopleResponse:
dataset_path = os.path.join(DATASET_ROOT, request.task_name)
known_people_names = [
f
for f in os.listdir(dataset_path)
if os.path.isdir(os.path.join(dataset_path, f))
]
rospy.set_param("/known_people", known_people_names)
return CheckKnownPeopleResponse(known_people_names)

rospy.Service("/check_known_people", CheckKnownPeople, check_known_people)
rospy.loginfo("Check known people service started")
rospy.spin()
1 change: 0 additions & 1 deletion common/vision/lasr_vision_deepface/nodes/service
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ from lasr_vision_msgs.srv import (
DetectFacesResponse,
)


rospy.init_node("recognise_service")

# Determine variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
rospkg.RosPack().get_path("lasr_vision_deepface"), "datasets"
)


Mat = np.ndarray


Expand Down Expand Up @@ -100,8 +99,8 @@ def create_dataset(
face_cropped_cv_im = _extract_face(cv_im)
if face_cropped_cv_im is None:
continue
cv2.imwrite(os.path.join(dataset_path, f"{name}_{i+1}.png"), face_cropped_cv_im) # type: ignore
rospy.loginfo(f"Took picture {i+1}")
cv2.imwrite(os.path.join(dataset_path, f"{name}_{i + 1}.png"), face_cropped_cv_im) # type: ignore
rospy.loginfo(f"Took picture {i + 1}")
images.append(face_cropped_cv_im)
if debug_publisher is not None:
debug_publisher.publish(
Expand Down Expand Up @@ -132,6 +131,7 @@ def recognise(

# Run inference
rospy.loginfo("Running inference")

try:
result = DeepFace.find(
cv_im,
Expand Down Expand Up @@ -197,7 +197,6 @@ def detect_faces(
request: DetectFacesRequest,
debug_publisher: Union[rospy.Publisher, None],
) -> DetectFacesResponse:

cv_im = cv2_img.msg_to_cv2_img(request.image_raw)

response = DetectFacesResponse()
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
torchvision==0.16.0
31 changes: 1 addition & 30 deletions common/vision/lasr_vision_feature_extraction/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1 @@
certifi==2023.11.17 # via requests
charset-normalizer==3.3.2 # via requests
filelock==3.13.1 # via torch, triton
fsspec==2023.10.0 # via torch
idna==3.4 # via requests
jinja2==3.1.2 # via torch
markupsafe==2.1.3 # via jinja2
mpmath==1.3.0 # via sympy
networkx==3.2.1 # via torch
numpy==1.26.2 # via torchvision
nvidia-cublas-cu12==12.1.3.1 # via nvidia-cudnn-cu12, nvidia-cusolver-cu12, torch
nvidia-cuda-cupti-cu12==12.1.105 # via torch
nvidia-cuda-nvrtc-cu12==12.1.105 # via torch
nvidia-cuda-runtime-cu12==12.1.105 # via torch
nvidia-cudnn-cu12==8.9.2.26 # via torch
nvidia-cufft-cu12==11.0.2.54 # via torch
nvidia-curand-cu12==10.3.2.106 # via torch
nvidia-cusolver-cu12==11.4.5.107 # via torch
nvidia-cusparse-cu12==12.1.0.106 # via nvidia-cusolver-cu12, torch
nvidia-nccl-cu12==2.18.1 # via torch
nvidia-nvjitlink-cu12==12.3.101 # via nvidia-cusolver-cu12, nvidia-cusparse-cu12
nvidia-nvtx-cu12==12.1.105 # via torch
pillow==10.1.0 # via torchvision
requests==2.31.0 # via torchvision
sympy==1.12 # via torch
torch==2.1.0 # via torchvision
torchvision==0.16.0 # via -r requirements.in
triton==2.1.0 # via torch
typing-extensions==4.8.0 # via torch
urllib3==2.1.0 # via requests

1 change: 1 addition & 0 deletions common/vision/lasr_vision_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ add_service_files(
PointingDirection.srv
TorchFaceFeatureDetectionDescription.srv
DetectFaces.srv
CheckKnownPeople.srv
)

# Generate actions in the 'action' folder
Expand Down
5 changes: 5 additions & 0 deletions common/vision/lasr_vision_msgs/srv/CheckKnownPeople.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Task name - receptionist, carry my luggage, etc
string task_name
---
# Known people names
string[] known_people
6 changes: 3 additions & 3 deletions common/vision/lasr_vision_msgs/srv/LearnFace.srv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Name to associate
string name

# Dataset to add face to
string dataset

# Name to associate
string name

# Number of images to take
int32 n_images

Expand Down
22 changes: 22 additions & 0 deletions skills/scripts/test_learn_face.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3

import rospy
import smach
from lasr_skills import LearnFace

if __name__ == "__main__":
rospy.init_node("learn_face")
# make segmentation instead for create dataset

s = smach.StateMachine(outcomes=["succeeded", "failed"])
with s:
smach.StateMachine.add(
"LEARN_FACE",
LearnFace(dataset="receptionist", name="nicole", n_images=10),
transitions={
"succeeded": "succeeded",
"failed": "failed",
},
)

s.execute()
31 changes: 31 additions & 0 deletions skills/scripts/test_look_at_person.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3

import rospy
import smach
import smach_ros
from lasr_skills.vision import GetPointCloud
from lasr_skills import LookAtPerson


if __name__ == "__main__":
rospy.init_node("look_at_person")
sm = smach.StateMachine(outcomes=["succeeded", "failed"])
with sm:
smach.StateMachine.add(
"GET_POINTCLOUD",
GetPointCloud("/xtion/depth_registered/points"),
transitions={"succeeded": "succeeded"},
remapping={"pcl_msg": "pcl_msg"},
)

sis = smach_ros.IntrospectionServer("pointcloud_server", sm, "/LOOK_AT_PERSON")
sis.start()
sm.execute()
pcl = sm.userdata.pcl_msg
sis.stop()

sm = LookAtPerson(filter=False)
sm.userdata.pcl_msg = pcl
sm.userdata.deepface_detection = []
outcome = sm.execute()
print(outcome)
2 changes: 2 additions & 0 deletions skills/src/lasr_skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
from .detect_faces import DetectFaces
from .recognise import Recognise
from .detect_gesture import DetectGesture
from .learn_face import LearnFace
from .look_at_person import LookAtPerson
from .find_gesture_person import FindGesturePerson
1 change: 0 additions & 1 deletion skills/src/lasr_skills/find_named_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from geometry_msgs.msg import Pose, PoseWithCovarianceStamped, Point, Quaternion


from typing import List, Union


Expand Down
26 changes: 26 additions & 0 deletions skills/src/lasr_skills/learn_face.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import rospy
import smach
from lasr_vision_msgs.srv import LearnFace as LearnFaceSrv


class LearnFace(smach.State):
def __init__(
self,
dataset: str,
name: str,
n_images: int,
):
smach.State.__init__(self, outcomes=["succeeded", "failed"])

self._dataset = dataset
self._name = name
self._n_images = n_images
self._learn_face = rospy.ServiceProxy("/learn_face", LearnFaceSrv)

def execute(self, userdata):
try:
result = self._learn_face(self._dataset, self._name, self._n_images)
return "succeeded"
except rospy.ServiceException as e:
rospy.logwarn(f"Unable to learn face. ({str(e)})")
return "failed"
Loading