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


Python FileIO.read_histograms_from_file方法代码示例

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


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

示例1: Part2

# 需要导入模块: import FileIO [as 别名]
# 或者: from FileIO import read_histograms_from_file [as 别名]
def Part2(createData):
    # optical flow and motion direction histogram calculation
    v = 100

    # mdh_all = OM.createMotionDirectionHistograms('Oberstdorf16-shots.csv', 'videos/oberstdorf16.mp4', v, False, True)
    # FileIO.save_histograms_to_file('mdh_16_' + str(v) + '.csv', mdh_all)

    if createData:
        SVM.save_shot_images('videos/oberstdorf16.mp4', SVM.SSI_CENTER, 'Oberstdorf16-shots.csv', False)

    #svm training and predicting
    mdh_training = FileIO.read_histograms_from_file('mdh_8_' + str(v) + '.csv')
    mdh_test = FileIO.read_histograms_from_file('mdh_16_' + str(v) + '.csv')
    predicted_labels = SVM.svm_use(mdh_training, mdh_test)

    stitched_shots, all_shots, outstitched_shots = SVM.get_results(
        predicted_labels, 'Oberstdorf16-shots.csv', True)


    return stitched_shots, all_shots, outstitched_shots
开发者ID:zexe,项目名称:video_ret_proj1,代码行数:22,代码来源:Part2.py

示例2: Part1

# 需要导入模块: import FileIO [as 别名]
# 或者: from FileIO import read_histograms_from_file [as 别名]
def Part1():
    # values = [100, 200, 500, 1000]
    values = [100]

    for v in values:
        print "Points: " + str(v)

        #optical flow and motion direction histogram calculation
        # mdh_all = OM.createMotionDirectionHistograms('GroundTruth.csv', 'videos/oberstdorf08small.mp4', v, False, False)
        # FileIO.save_histograms_to_file('mdh_8_' + str(v) + '.csv', mdh_all)
        # print "Histograms created."

        # #svm training and predicting
        mdh_compl = FileIO.read_histograms_from_file('mdh_8_' + str(v) + '.csv')
        accuracy, ITERATIONS, NF = SVM.svm_accuracy(mdh_compl)
        print "average accuracy: " + str(accuracy/ITERATIONS/NF)
开发者ID:zexe,项目名称:video_ret_proj1,代码行数:18,代码来源:Part1.py


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