Skip to content

Commit

Permalink
too many values to unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed Jun 4, 2024
1 parent a4222a9 commit 1e1ada2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def predict(self, rgb_image: np.ndarray) -> ImageWithMasksAndAttributes:
image_tensor = (
torch.from_numpy(rgb_image).permute(2, 0, 1).unsqueeze(0).float() / 255.0
)
pred_masks, pred_classes = self.model(image_tensor)
pred_masks, pred_classes = self.model(image_tensor) # todo: too many fucking values to unpack (expected 2)
# Apply binary erosion and dilation to the masks
pred_masks = binary_erosion_dilation(
pred_masks,
Expand Down Expand Up @@ -472,7 +472,7 @@ def predict_frame(
torso_frame = pad_image_to_even_dims(torso_frame)

rst_person = ImageOfPerson.from_parent_instance(head_predictor.predict(head_frame)).describe()
rst_cloth = ImageOfCloth.from_parent_instance(torso_frame.predict(torso_frame)).describe()
rst_cloth = ImageOfCloth.from_parent_instance(cloth_predictor.predict(torso_frame)).describe()

# results from two dictionaries are currently merged but might got separated again in the future if needed.
result = {
Expand Down
1 change: 0 additions & 1 deletion skills/src/lasr_skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@
from .clip_vqa import QueryImage
from .detect_faces import DetectFaces
from .recognise import Recognise
from .detect_pointing import DetectPointingDirection
from .detect_gesture import DetectGesture
from .find_gesture_person import FindGesturePerson
8 changes: 2 additions & 6 deletions skills/src/lasr_skills/describe_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ def execute(self, userdata):
masks = [torso, head]
result = self.bodypix(userdata.img_msg, "resnet50", 0.7, masks)
userdata.bodypix_masks = result.masks
rospy.logdebug("Found poses: %s" % str(len(result.poses)))
neck_coord = (
int(result.poses[0].coord[0]),
int(result.poses[0].coord[1]),
)
rospy.logdebug("Coordinate of the neck is: %s" % str(neck_coord))
return "succeeded"
except rospy.ServiceException as e:
rospy.logerr(f"Unable to perform inference. ({str(e)})")
Expand Down Expand Up @@ -203,6 +197,8 @@ def execute(self, userdata):
)

full_frame = cv2_img.cv2_img_to_msg(img)
rospy.loginfo(type(img))
rospy.loginfo(type(full_frame))

rst = self.face_features(
full_frame,
Expand Down

0 comments on commit 1e1ada2

Please sign in to comment.