代码拉取完成,页面将自动刷新
import glob
import numpy as np
models = ["c3d", "lstm"]
for model in models:
normal_predictions_regex = "predictions_{}/Normal*".format(model)
abnormal_predictions_regex = "predictions_{}/[!Normal]*".format(model)
normal_predictions = glob.glob(normal_predictions_regex)
abnormal_predictions = glob.glob(abnormal_predictions_regex)
normal_pos_preds = 0
normal_videos = 0
for vid in normal_predictions:
preds = np.load(vid)
normal_videos += 1
normal_pos_preds += np.max(np.round(preds))
abnormal_pos_preds = 0
abnormal_videos = 0
for vid in abnormal_predictions:
preds = np.load(vid)
abnormal_videos += 1
abnormal_pos_preds += np.max(np.round(preds))
print("MODEL: {}".format(model))
print("Normal videos with positive labels: {} %".format(
100*normal_pos_preds/normal_videos))
print("Abnormal videos with positive labels: {} %".format(
100*abnormal_pos_preds/abnormal_videos))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。