Skip to content

Commit

Permalink
fixed that torsal and head frames were inversed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma authored and tiago committed Feb 5, 2024
1 parent e8b2012 commit 77feadb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Binary file added common/vision/lasr_vision_torch/full_frame.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added common/vision/lasr_vision_torch/head_frame.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import rospkg
import lasr_vision_torch
from os import path
# import matplotlib.pyplot as plt


def load_face_classifier_model():
Expand Down Expand Up @@ -122,8 +123,9 @@ def process_head(head_frame, model, thresholds_mask, erosion_iterations, dilatio

if head_frame is not None:
# try:
# r = rospkg.RosPack()
# _head_frame_bgr = cv2.cvtColor(head_frame, cv2.COLOR_RGB2BGR)
# cv2.imshow('Head Frame', _head_frame_bgr)
# cv2.imwrite(path.join(r.get_path("lasr_vision_torch"), 'head_frame.jpg'), _head_frame_bgr)
# except Exception as ignore:
# pass

Expand Down Expand Up @@ -228,6 +230,17 @@ def predict_frame(head_frame, torso_frame, full_frame, head_mask, torso_mask, mo

head_frame = pad_image_to_even_dims(head_frame)
torso_frame = pad_image_to_even_dims(torso_frame)

try:
r = rospkg.RosPack()
_full_frame_bgr = cv2.cvtColor(full_frame, cv2.COLOR_RGB2BGR)
cv2.imwrite(path.join(r.get_path("lasr_vision_torch"), 'full_frame.jpg'), _full_frame_bgr)
_head_frame_bgr = cv2.cvtColor(head_frame, cv2.COLOR_RGB2BGR)
cv2.imwrite(path.join(r.get_path("lasr_vision_torch"), 'head_frame.jpg'), _head_frame_bgr)
_torso_frame_bgr = cv2.cvtColor(torso_frame, cv2.COLOR_RGB2BGR)
cv2.imwrite(path.join(r.get_path("lasr_vision_torch"), 'torso_frame.jpg'), _torso_frame_bgr)
except Exception as ignore:
pass

# Process head and cloth separately for the single frame
head_class_count, head_class_colours = process_head(head_frame, model, thresholds_mask, erosion_iterations, dilation_iterations, thresholds_pred)
Expand Down
Binary file added common/vision/lasr_vision_torch/torso_frame.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion skills/src/lasr_skills/describe_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def execute(self, userdata):
full_frame = cv2_img.cv2_img_to_msg(img)
features.extend(self.torch_face_features(
full_frame,
torso_mask_data, torso_mask_shape, torso_mask_dtype,
head_mask_data, head_mask_shape, head_mask_dtype,
torso_mask_data, torso_mask_shape, torso_mask_dtype,
).detected_features)

# # process part masks
Expand Down

0 comments on commit 77feadb

Please sign in to comment.