metrics添加baseline信息

This commit is contained in:
zhiyang7 2021-12-27 10:06:35 +08:00
parent 47e6aa8987
commit 6b6b0ed552
1 changed files with 16 additions and 6 deletions

View File

@ -33,12 +33,15 @@ RealCard2EnvCard = {'3': 3, '4': 4, '5': 5, '6': 6, '7': 7,
baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(1)
if len(baselines) >= 1:
baseline = baselines[0]
try:
players = [
DeepAgent('landlord', str(baseline.landlord_path), use_onnx=True),
DeepAgent('landlord_down', str(baseline.landlord_down_path), use_onnx=True),
DeepAgent('landlord_front', str(baseline.landlord_front_path), use_onnx=True),
DeepAgent('landlord_up', str(baseline.landlord_up_path), use_onnx=True)
]
except:
pass
@app.route('/upload', methods=['POST'])
def upload():
@ -75,6 +78,13 @@ def metrics():
for i in range(len(baselines)):
baseline = baselines[i]
baseline_metric = {
'baseline': {
'landlord_wp': '%.4f' % float(baseline.landlord_wp),
'landlord_adp': '%.4f' % float(baseline.landlord_adp),
'farmer_wp': '%.4f' % float(baseline.farmer_wp),
'farmer_adp': '%.4f' % float(baseline.farmer_adp),
'create_time': str(baseline.create_time)
},
'landlord': {},
'landlord_up': {},
'landlord_front': {},