Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
teowu committed Aug 11, 2023
1 parent 69d7b28 commit 01bb306
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions evaluate_a_set_of_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@


def fuse_results(results: list):
a, t = (results[0] - 0.1107) / 0.07355, (results[1] + 0.08285) / 0.03774
x = a * 0.6104 + t * 0.3896
## results[0]: aesthetic, results[1]: technical
## thank @dknyxh for raising the issue
t, a = (results[1] - 0.1107) / 0.07355, (results[0] + 0.08285) / 0.03774
x = t * 0.6104 + a * 0.3896
return {
"aesthetic": 1 / (1 + np.exp(-a)),
"technical": 1 / (1 + np.exp(-t)),
Expand Down Expand Up @@ -133,6 +135,9 @@ def fuse_results(results: list):
# f"dover_predictions/val-custom_{args.input_video_dir.split('/')[-1]}.pkl", "wb"
# ) as wf:
# pkl.dump(all_results, wf)

with open("zero_shot_res_sensehdr.txt","a") as wf:
wf.write(f'{data["name"][0].split("/")[-1]},{rescaled_results["aesthetic"]*100:4f}, {rescaled_results["technical"]*100:4f},{rescaled_results["overall"]*100:4f}\n')

with open(args.output_result_csv, "a") as w:
w.write(
Expand Down

0 comments on commit 01bb306

Please sign in to comment.