當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。