由于全规需要,修改了透出标签,将后台类目映射为前台类目,并修改了代码,不再透出层级类目,只透出最终细分类目。
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/9615279
master
| @@ -159,10 +159,17 @@ TASK_OUTPUTS = { | |||||
| # } | # } | ||||
| Tasks.action_recognition: [OutputKeys.LABELS], | Tasks.action_recognition: [OutputKeys.LABELS], | ||||
| # live category recognition result for single video | |||||
| # { | |||||
| # "scores": [0.885272, 0.014790631, 0.014558001], | |||||
| # 'labels': ['修身型棉衣', '高腰牛仔裤', '休闲连体裤'] | |||||
| # } | |||||
| Tasks.live_category: [OutputKeys.SCORES, OutputKeys.LABELS], | |||||
| # video category recognition result for single video | # video category recognition result for single video | ||||
| # { | # { | ||||
| # "scores": [0.7716429233551025] | |||||
| # "labels": ['生活>>好物推荐'], | |||||
| # "scores": [0.7716429233551025], | |||||
| # "labels": ['生活>>好物推荐'] | |||||
| # } | # } | ||||
| Tasks.video_category: [OutputKeys.SCORES, OutputKeys.LABELS], | Tasks.video_category: [OutputKeys.SCORES, OutputKeys.LABELS], | ||||
| @@ -85,7 +85,7 @@ class LiveCategoryPipeline(Pipeline): | |||||
| for label_key in label_keys: | for label_key in label_keys: | ||||
| if label_info[label_key] not in label_str: | if label_info[label_key] not in label_str: | ||||
| label_str.append(label_info[label_key]) | label_str.append(label_info[label_key]) | ||||
| labels.append('>>'.join(label_str)) | |||||
| labels.append(label_str[-1]) | |||||
| return {OutputKeys.SCORES: list(scores), OutputKeys.LABELS: labels} | return {OutputKeys.SCORES: list(scores), OutputKeys.LABELS: labels} | ||||
| def postprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]: | def postprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]: | ||||
| @@ -61,7 +61,6 @@ class CVTasks(object): | |||||
| video_category = 'video-category' | video_category = 'video-category' | ||||
| video_embedding = 'video-embedding' | video_embedding = 'video-embedding' | ||||
| virtual_try_on = 'virtual-try-on' | virtual_try_on = 'virtual-try-on' | ||||