-
Notifications
You must be signed in to change notification settings - Fork 10
/
count.py
36 lines (31 loc) · 792 Bytes
/
count.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
# import glob
# import pickle
# import torch
# import math
# import torch.utils.data
# import torch.nn as nn
import numpy as np
import random
path = '/data1/cxg6/eval_data'
np.random.seed(1)
p_path = os.listdir(path)
p_path.sort()
p_path = np.array(p_path)
index = np.random.choice(len(p_path), int(len(p_path)*0.8), replace=False)
data_names = p_path[index]
print(len(data_names))
num = 0
length = 0
score = 0
for data_name in data_names:
data_path = os.path.join(path, data_name)
data = np.load(data_path, allow_pickle=True)
length += len(data['frame'])
score += (data['antipodal_score']).sum()
num += 1
if num % 10 == 0:
print("rest:", len(data_names)-num)
print(score / length, length/num)
print(length/num)
print(score/length)