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': {},