0
点赞
收藏
分享

微信扫一扫

Python计算检测视频帧图片保存的txt文档分数

Brose 2022-02-21 阅读 67
from nis import match
from numpy import *
import operator
from os import listdir
import os
import re

fr = open("output.txt",'r')
res = []
cnt = 0
total = 0
lines = fr.readlines()
for line in lines:
    print(line)
    splitLine = line.split('score:  ')
    res.append(splitLine[1])

print("\nTotal Error detection: {}".format(len(lines)))
print("The max score: {}".format(max(res)))
print("The min score: {}".format(min(res)))

for i in res:
    total += float(res[cnt].replace("\n",""))
    cnt += 1
average = total /cnt
print("The average score:  {}".format(average))

path = "./save"
count = 0
for num in os.listdir(path):
    count += 1
print("Total file: {}".format(count))

print("avg_num: {}".format(len(lines)/count))
举报

相关推荐

0 条评论