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