metrics添加baseline信息
This commit is contained in:
parent
47e6aa8987
commit
6b6b0ed552
|
@ -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)
|
baselines = Baseline.select().order_by(Baseline.rank.desc()).limit(1)
|
||||||
if len(baselines) >= 1:
|
if len(baselines) >= 1:
|
||||||
baseline = baselines[0]
|
baseline = baselines[0]
|
||||||
|
try:
|
||||||
players = [
|
players = [
|
||||||
DeepAgent('landlord', str(baseline.landlord_path), use_onnx=True),
|
DeepAgent('landlord', str(baseline.landlord_path), use_onnx=True),
|
||||||
DeepAgent('landlord_down', str(baseline.landlord_down_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_front', str(baseline.landlord_front_path), use_onnx=True),
|
||||||
DeepAgent('landlord_up', str(baseline.landlord_up_path), use_onnx=True)
|
DeepAgent('landlord_up', str(baseline.landlord_up_path), use_onnx=True)
|
||||||
]
|
]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
@app.route('/upload', methods=['POST'])
|
@app.route('/upload', methods=['POST'])
|
||||||
def upload():
|
def upload():
|
||||||
|
@ -75,6 +78,13 @@ def metrics():
|
||||||
for i in range(len(baselines)):
|
for i in range(len(baselines)):
|
||||||
baseline = baselines[i]
|
baseline = baselines[i]
|
||||||
baseline_metric = {
|
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': {},
|
||||||
'landlord_up': {},
|
'landlord_up': {},
|
||||||
'landlord_front': {},
|
'landlord_front': {},
|
||||||
|
|
Loading…
Reference in New Issue