From 6b6b0ed552456fe133f207695ff97cdc96134de2 Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Mon, 27 Dec 2021 10:06:35 +0800 Subject: [PATCH] =?UTF-8?q?metrics=E6=B7=BB=E5=8A=A0baseline=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- evaluate_server.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/evaluate_server.py b/evaluate_server.py index 8e8815a..37554e4 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -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] - 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) - ] + 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': {},