当前位置: 首页>>代码示例>>Python>>正文


Python MAX_API.model方法代码示例

本文整理汇总了Python中maxfw.core.MAX_API.model方法的典型用法代码示例。如果您正苦于以下问题:Python MAX_API.model方法的具体用法?Python MAX_API.model怎么用?Python MAX_API.model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maxfw.core.MAX_API的用法示例。


在下文中一共展示了MAX_API.model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from maxfw.core import MAX_API [as 别名]
# 或者: from maxfw.core.MAX_API import model [as 别名]
def get(self):
        '''Return the list of labels that can be predicted by the model'''
        result = {}
        result['labels'] = [{'id': l[0], 'name': l[1], 'description': tag_desc[l[1]] if l[1] in tag_desc else ''}
                            for l in model_wrapper.id_to_tag.items()]  # noqa (E741 ambiguous variable name 'l')
        result['count'] = len(model_wrapper.id_to_tag)
        return result

# === Predict API 
开发者ID:IBM,项目名称:MAX-Named-Entity-Tagger,代码行数:11,代码来源:predict.py

示例2: get

# 需要导入模块: from maxfw.core import MAX_API [as 别名]
# 或者: from maxfw.core.MAX_API import model [as 别名]
def get(self):
        """Return the list of labels that can be predicted by the model"""

        labels = [{"id": 0, "name": 'background'},
                  {"id": 1, "name": 'aeroplane'},
                  {"id": 2, "name": 'bicycle'},
                  {"id": 3, "name": 'bird'},
                  {"id": 4, "name": 'boat'},
                  {"id": 5, "name": 'bottle'},
                  {"id": 6, "name": 'bus'},
                  {"id": 7, "name": 'car'},
                  {"id": 8, "name": 'cat'},
                  {"id": 9, "name": 'chair'},
                  {"id": 10, "name": 'cow'},
                  {"id": 11, "name": 'diningtable'},
                  {"id": 12, "name": 'dog'},
                  {"id": 13, "name": 'horse'},
                  {"id": 14, "name": 'motorbike'},
                  {"id": 15, "name": 'person'},
                  {"id": 16, "name": 'pottedplant'},
                  {"id": 17, "name": 'sheep'},
                  {"id": 18, "name": 'sofa'},
                  {"id": 19, "name": 'train'},
                  {"id": 20, "name": 'tv'}]

        return labels 
开发者ID:IBM,项目名称:MAX-Image-Segmenter,代码行数:28,代码来源:predict.py

示例3: get

# 需要导入模块: from maxfw.core import MAX_API [as 别名]
# 或者: from maxfw.core.MAX_API import model [as 别名]
def get(self):
        '''Return the list of labels that can be predicted by the model.'''
        result = dict()
        result['labels'] = {label: label_description[label] for label in label_description}
        result['count'] = len(label_description.keys())
        return result 
开发者ID:IBM,项目名称:MAX-Toxic-Comment-Classifier,代码行数:8,代码来源:predict.py

示例4: get

# 需要导入模块: from maxfw.core import MAX_API [as 别名]
# 或者: from maxfw.core.MAX_API import model [as 别名]
def get(self):
        """Return the list of labels that can be predicted by the model"""
        return {
            'labels': model_wrapper.categories,
            'count': len(model_wrapper.categories)
        } 
开发者ID:IBM,项目名称:MAX-Object-Detector,代码行数:8,代码来源:predict.py


注:本文中的maxfw.core.MAX_API.model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。