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


Python Features.getAllFeatureClasses方法代码示例

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


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

示例1: createDataLine

# 需要导入模块: import Features [as 别名]
# 或者: from Features import getAllFeatureClasses [as 别名]
def createDataLine(context, block, leaveout=-1):
    dataLine = [str(block[0].shotId) + "_" + str(block[0].beatId), str(block[0].shot)]
    featureClassList = Features.getAllFeatureClasses()
    context = Features.createBeatList(context, block)
    for featureClass in featureClassList:
        feature = featureClass(context, block)
        dataLine += feature.getNumbers()
        # activate to generate a human readable featureLine
        #dataLine.append(feature.getText())
    if leaveout >= 0:
        dataLine.pop(leaveout)
    return dataLine
开发者ID:flair2005,项目名称:Automoculus,代码行数:14,代码来源:ConvertData.py

示例2: getFeatureNames

# 需要导入模块: import Features [as 别名]
# 或者: from Features import getAllFeatureClasses [as 别名]
def getFeatureNames(leave_out_class=None):
    """
    Returns an array of feature names corresponding to the featureLine.
    """
    names = []
    featureClassList = Features.getAllFeatureClasses()
    context = createContext()
    dummy_beat = Beat("0_1\tfull_shot\tfalse\tintroduce\tperson§Nobody", context)
    context = Features.createBeatList(context, [dummy_beat])
    Features.initializeContextVars(context)
    for featureClass in [x for x in featureClassList if x != leave_out_class]:
        feature = featureClass(context, [dummy_beat])
        names += feature.getNames()
    return names
开发者ID:flair2005,项目名称:Automoculus,代码行数:16,代码来源:ConvertData.py

示例3: getFeatureLine

# 需要导入模块: import Features [as 别名]
# 或者: from Features import getAllFeatureClasses [as 别名]
def getFeatureLine(context, block, shot, lastShotId, leave_out_class=None):
    """
    This function creates a featureLine. This is done by calculating getNumbers() for
    all Feature-Classes in Features.py and appending the desired class. A featureLine
    consists of several Numbers and a String at the end for the class.
    """
    line = []
    featureClassList = Features.getAllFeatureClasses()
    context = Features.createBeatList(context, block)
    # use all features except leave_out_class if given
    #for featureClass in [x for x in featureClassList if x != leave_out_class]:
    # use only features which contribute significant information
    for featureClass in [featureClassList[x] for x in range(len(featureClassList)) if
                         x in [9, 10, 11, 12, 13, 15, 19, 25, 27, 28, 30, 31, 32, 33, 37,
                               39, 41, 42]]:
        feature = featureClass(context, block)
        line += feature.getNumbers()
    if shot:
        line.append(SHOT_NAMES[block[0].shot])
    else:#is there a cut?
        line.append(str(lastShotId != block[0].shotId))
    return line
开发者ID:flair2005,项目名称:Automoculus,代码行数:24,代码来源:ConvertData.py


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