本文整理匯總了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)
}