Skip to content

Commit

Permalink
Changed 'usb_cam' to 'camera'
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed May 17, 2024
1 parent 7f3a76f commit d1f4452
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common/vision/lasr_vision_feature_extraction/nodes/service
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lasr_vision_msgs.srv import TorchFaceFeatureDetectionDescription, TorchFaceFeatureDetectionDescriptionRequest, TorchFaceFeatureDetectionDescriptionResponse
from lasr_vision_feature_extraction.categories_and_attributes import CategoriesAndAttributes, CelebAMaskHQCategoriesAndAttributes
from lasr_vision_feature_extraction.categories_and_attributes import CategoriesAndAttributes, CelebAMaskHQCategoriesAndAttributes, DeepFashion2GeneralizedCategoriesAndAttributes

from cv2_img import msg_to_cv2_img
from numpy2message import message2numpy
Expand Down Expand Up @@ -35,7 +35,7 @@ if __name__ == '__main__':
head_model = lasr_vision_feature_extraction.load_face_classifier_model()
head_predictor = lasr_vision_feature_extraction.Predictor(head_model, torch.device('cpu'), CelebAMaskHQCategoriesAndAttributes)
cloth_model = lasr_vision_feature_extraction.load_cloth_classidifer_model()
cloth_predictor = lasr_vision_feature_extraction.Predictor(cloth_model, torch.device('cpu'), CelebAMaskHQCategoriesAndAttributes)
cloth_predictor = lasr_vision_feature_extraction.Predictor(cloth_model, torch.device('cpu'), DeepFashion2GeneralizedCategoriesAndAttributes)
rospy.init_node('torch_service')
rospy.Service('/torch/detect/face_features', TorchFaceFeatureDetectionDescription, detect)
rospy.loginfo('Torch service started')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class SegmentPredictor(nn.Module):
def __init__(self, num_masks, num_labels, in_channels=3, sigmoid=True):
super(SegmentPredictor, self).__init__()
self.sigmoid = sigmoid
self.resnet = models.resnet18(pretrained=True)
self.resnet = models.resnet18(pretrained=False)

# Adapt ResNet to handle different input channel sizes
if in_channels != 3:
Expand Down Expand Up @@ -476,8 +476,8 @@ def predict_frame(

# results from two dictionaries are currently merged but might got separated again in the future if needed.
result = {
'attributes': rst_person['rst_person'] + rst_cloth['rst_person'],
'description': rst_person['rst_person'] + rst_cloth['rst_person'],
'attributes': rst_person['attributes'] + rst_person['description'],
'description': rst_cloth['attributes'] + rst_cloth['description'],
}

result = json.dumps(result, indent=4)
Expand Down
2 changes: 1 addition & 1 deletion skills/src/lasr_skills/vision/get_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, topic: str = None):
self.topic = (
"/xtion/rgb/image_raw"
if "tiago" in os.environ["ROS_MASTER_URI"]
else "/usb_cam/image_raw"
else "/camera/image_raw"
)
else:
self.topic = topic
Expand Down

0 comments on commit d1f4452

Please sign in to comment.