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 fixes #260

Merged
merged 47 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
00bcbe0
Documentation - adding in how to run the receptionist task
zoe013evans Apr 29, 2024
1c6becd
robustifying receptionist
May 14, 2024
0c3b2a8
adding fixes to state machine
May 28, 2024
4d34852
fixing conflict
May 28, 2024
6a38d09
Merge remote-tracking branch 'zoe-fork/main' into main
May 28, 2024
fd37557
Make receptionist more robust:
May 30, 2024
e782f02
Resolve merge conflicts
haiwei-luo Jun 24, 2024
6425a57
Resolve github flags
haiwei-luo Jun 24, 2024
d36a96f
Minor resolution
haiwei-luo Jun 24, 2024
ae06cd2
Minor fix
haiwei-luo Jun 24, 2024
a20681f
Merge branch 'LASR-at-Home:main' into main
haiwei-luo Jun 24, 2024
a24320e
Merging
haiwei-luo Jun 24, 2024
182b72a
Fix introduce guest
haiwei-luo Jun 24, 2024
e14e535
Merge branch 'LASR-at-Home:main' into main
haiwei-luo Jun 24, 2024
b612ed9
Adapt
haiwei-luo Jun 24, 2024
205897e
Merge branch 'main' of github.com:haiwei-luo/Base into main
haiwei-luo Jun 24, 2024
6eed3d9
Catch if attributes detection fail in main state machine
haiwei-luo Jun 26, 2024
97a0277
Remove learning face for guest2
haiwei-luo Jun 26, 2024
f2ba060
Identify look at person bug and reformatting
haiwei-luo Jun 26, 2024
4cf1a84
Handling no empty seat and no detection
haiwei-luo Jun 26, 2024
683636f
Add flag to indicate no detections
haiwei-luo Jun 26, 2024
b3e889a
Fix bugs
haiwei-luo Jun 26, 2024
94c8dc2
More spoken strings use informative
haiwei-luo Jun 27, 2024
3ee7a6c
Resolve move_base failure
haiwei-luo Jun 27, 2024
97321e9
Reformat
haiwei-luo Jun 27, 2024
32d08aa
Handle failure of learning faces
haiwei-luo Jun 27, 2024
60b30e3
reformat
haiwei-luo Jun 27, 2024
825419c
Respond to requested change on PR
haiwei-luo Jun 28, 2024
2f4beb0
Minor change
haiwei-luo Jun 28, 2024
9a21e67
Resolve conflict
haiwei-luo Jun 28, 2024
0d2de26
Resolve merge conflicts
haiwei-luo Jul 8, 2024
abc57b3
Resolve merge conflicts
haiwei-luo Jul 8, 2024
a90b53c
Add yaml files and fix bugs
haiwei-luo Jul 8, 2024
0c9215a
Reformat with black
haiwei-luo Jul 8, 2024
8b5162c
Remove dining area yaml
haiwei-luo Jul 8, 2024
d58fc12
Fix bug
haiwei-luo Jul 9, 2024
23ffe4d
Remove tiago's waffle!
haiwei-luo Jul 9, 2024
13c8060
Format
haiwei-luo Jul 9, 2024
5e09c27
Merge branch 'main' of github.com:haiwei-luo/Base into main
haiwei-luo Jul 9, 2024
7c926af
Fix slowness by removing sleep
haiwei-luo Jul 9, 2024
f41d022
Format by Jared's request
haiwei-luo Jul 9, 2024
b69529c
Merge branch 'main' of github.com:haiwei-luo/Base into main
haiwei-luo Jul 15, 2024
e32aad2
Setup speechand yaml for receptionist in Robocup
haiwei-luo Jul 15, 2024
9e0ac88
Fix commas in speech recovery
haiwei-luo Jul 15, 2024
eb5c904
Merge branch 'main' of github.com:haiwei-luo/Base into main
haiwei-luo Jul 15, 2024
9ec5045
Fix features!
haiwei-luo Jul 15, 2024
3af1dc8
Reformat with black on the rexy laptop even though the leg tracker fa…
haiwei-luo Jul 15, 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
2 changes: 1 addition & 1 deletion common/vision/lasr_vision_clip/nodes/vqa
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VqaService:
"""
possible_answers = request.possible_answers
answer, cos_score, annotated_img = query_image(
self._model, request.image_raw, possible_answers, annotate=True
request.image_raw, self._model, possible_answers, annotate=True
)

self._debug_pub.publish(annotated_img)
Expand Down
4 changes: 1 addition & 3 deletions common/vision/lasr_vision_feature_extraction/nodes/service
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def detect(
head_frame,
torso_frame,
full_frame,
head_mask,
torso_mask,
request.image_raw,
image_raw=request.image_raw,
cloth_predictor=cloth_predictor,
)
response = TorchFaceFeatureDetectionDescriptionResponse()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ def predict_frame(
head_frame,
torso_frame,
full_frame,
head_mask,
torso_mask,
cloth_predictor,
image_raw,
clip_service: rospy.ServiceProxy = rospy.ServiceProxy(
Expand All @@ -568,10 +566,7 @@ def predict_frame(
).describe()

# 0.5 for True, -0.5 for False
rst_person = {
"glasses": -0.5,
"hat": -0.5,
}
rst_person = {"glasses": -0.5, "hat": -0.5, "hair_shape": "short hair"}

glasses_query = VqaRequest(
possible_answers=["A person wearing glasses", "A person not wearing glasses"],
Expand All @@ -583,14 +578,24 @@ def predict_frame(
image_raw=image_raw,
)

hair_query = VqaRequest(
possible_answers=["A person with short hair", "A person with long hair"],
image_raw=image_raw,
)

glasses_response = clip_service(glasses_query)
hat_response = clip_service(hat_query)

if glasses_response.answer == "A person wearing glasses":
rst_person["glasses"] = 0.5
hat_response = clip_service(hat_query)
if hat_response.answer == "A person wearing a hat":
rst_person["hat"] = 0.5

hair_response = clip_service(hair_query)

if hair_response.answer == "A person with long hair":
rst_person["hair_shape"] = "long hair"

result = {
**rst_person,
**rst_cloth,
Expand Down
3 changes: 1 addition & 2 deletions tasks/receptionist/launch/setup.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<node pkg="lasr_vision_feature_extraction" type="service" name="torch_service" output="screen"/>
<node pkg="lasr_vision_clip" name="clip_service" type="vqa" output="screen"/>
<arg name="debug" default="true" />
<node pkg="lasr_vision_bodypix" type="mask_service.py" name="bodypix_service" output="screen" args="--debug $(arg debug)"/>
<node pkg="lasr_vision_bodypix" type="keypoint_service.py" name="bodypix__keypoint_service" output="screen" args="--debug $(arg debug)"/>
<node pkg="lasr_vision_bodypix" type="bodypix_services.py" name="bodypix_service" output="screen" args="--debug $(arg debug)"/>
<node pkg="lasr_vision_deepface" type="service" name="deepface_service" output="screen"/>

</launch>
14 changes: 7 additions & 7 deletions tasks/receptionist/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
rospy.loginfo(sofa_area.area)
rospy.loginfo(list(sofa_area.exterior.coords))
sofa_area_publisher.publish(
PolygonStamped(
polygon=Polygon(
points=[Point(x=x, y=y, z=0.0) for (x, y) in sofa_area.exterior.coords]
),
header=Header(frame_id="map"),
)
PolygonStamped(
polygon=Polygon(
points=[Point(x=x, y=y, z=0.0) for (x, y) in sofa_area.exterior.coords]
),
header=Header(frame_id="map"),
)
)
#rospy.spin()
# rospy.spin()
# assert sofa_area.is_valid, "Sofa area is not valid"

sofa_point = Point(**sofa_point_param)
Expand Down
16 changes: 9 additions & 7 deletions tasks/receptionist/src/receptionist/states/introduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ def stringify_guest_data(
},
)

relevant_guest_data["attributes"]["has_hair"] = 0.5

guest_str = f"{relevant_guest_data['name']}, their favourite drink is {relevant_guest_data['drink']}. "

if not relevant_guest_data["detection"] or not describe_features:
return guest_str

filtered_attributes = {}
# filtered_attributes["hair"] = {
# "confidence": relevant_guest_data["attributes"]["has_hair"],
# "hair_shape": relevant_guest_data["attributes"]["hair_shape"],
# "hair_colour": relevant_guest_data["attributes"]["hair_colour"],
# }
filtered_attributes["hair"] = {
"confidence": relevant_guest_data["attributes"]["has_hair"],
"hair_shape": relevant_guest_data["attributes"]["hair_shape"],
# "hair_colour": relevant_guest_data["attributes"]["hair_colour"],
}

most_confident_clothes = find_most_confident_clothes(
relevant_guest_data,
Expand Down Expand Up @@ -117,8 +119,8 @@ def stringify_guest_data(

if attribute_name == "hair":
hair_shape = attribute_value["hair_shape"]
hair_colour = attribute_value["hair_colour"]
guest_str += f"They have {hair_shape} and {hair_colour}. "
# hair_colour = attribute_value["hair_colour"]
guest_str += f"They have {hair_shape}. "
elif attribute_name == "facial_hair":
if confidence < 0:
guest_str += "They don't have facial hair. "
Expand Down