本文整理汇总了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
示例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)