本文整理汇总了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
示例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
示例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
示例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)
}