From bb63a8d4650d2e23cee6b4765897e8f6edd6eb77 Mon Sep 17 00:00:00 2001 From: "mulin.lyh" Date: Mon, 4 Sep 2023 13:30:38 +0800 Subject: [PATCH] remove error log Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/13891446 --- .../models/cv/referring_video_object_segmentation/utils/mttr.py | 1 + modelscope/pipelines/cv/face_emotion_pipeline.py | 2 +- modelscope/pipelines/cv/face_human_hand_detection_pipeline.py | 1 - modelscope/pipelines/cv/hand_static_pipeline.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modelscope/models/cv/referring_video_object_segmentation/utils/mttr.py b/modelscope/models/cv/referring_video_object_segmentation/utils/mttr.py index 48d4bf70..136208cd 100644 --- a/modelscope/models/cv/referring_video_object_segmentation/utils/mttr.py +++ b/modelscope/models/cv/referring_video_object_segmentation/utils/mttr.py @@ -65,6 +65,7 @@ class MTTR(nn.Module): # keep only the valid frames (frames which are annotated): # (for example, in a2d-sentences only the center frame in each window is annotated). for layer_out in backbone_out: + valid_indices = valid_indices.to(layer_out.tensors.device) layer_out.tensors = layer_out.tensors.index_select( 0, valid_indices) layer_out.mask = layer_out.mask.index_select(0, valid_indices) diff --git a/modelscope/pipelines/cv/face_emotion_pipeline.py b/modelscope/pipelines/cv/face_emotion_pipeline.py index 9d9aa6ee..f7882969 100644 --- a/modelscope/pipelines/cv/face_emotion_pipeline.py +++ b/modelscope/pipelines/cv/face_emotion_pipeline.py @@ -31,7 +31,7 @@ class FaceEmotionPipeline(Pipeline): logger.info('load model done') def preprocess(self, input: Input) -> Dict[str, Any]: - img = LoadImage.convert_to_ndarray(input['img_path']) + img = LoadImage.convert_to_ndarray(input) return img def forward(self, input: Dict[str, Any]) -> Dict[str, Any]: diff --git a/modelscope/pipelines/cv/face_human_hand_detection_pipeline.py b/modelscope/pipelines/cv/face_human_hand_detection_pipeline.py index a387703c..5fc70821 100644 --- a/modelscope/pipelines/cv/face_human_hand_detection_pipeline.py +++ b/modelscope/pipelines/cv/face_human_hand_detection_pipeline.py @@ -39,7 +39,6 @@ class NanoDettForFaceHumanHandDetectionPipeline(Pipeline): cls_list, bbox_list, score_list = det_infer.inference( self.model, self.device, input) - logger.info(cls_list, bbox_list, score_list) return { OutputKeys.LABELS: cls_list, OutputKeys.BOXES: bbox_list, diff --git a/modelscope/pipelines/cv/hand_static_pipeline.py b/modelscope/pipelines/cv/hand_static_pipeline.py index c020b7aa..ea908ed0 100644 --- a/modelscope/pipelines/cv/hand_static_pipeline.py +++ b/modelscope/pipelines/cv/hand_static_pipeline.py @@ -30,7 +30,7 @@ class HandStaticPipeline(Pipeline): logger.info('load model done') def preprocess(self, input: Input) -> Dict[str, Any]: - img = LoadImage.convert_to_ndarray(input['img_path']) + img = LoadImage.convert_to_ndarray(input) return img def forward(self, input: Dict[str, Any]) -> Dict[str, Any]: