DT
Description: Calculate the trajectory score in depth
URI: /algo/BT
http method: GET
@app.route('/algo/DT/<name>', methods=['GET'])
def DT(name):
if not request.json or 'seq' not in request.json:
return jsonify({"score":-1})
seq = request.json['seq']
size = len(seq)
score_list = []
for rid in seq:
payload = {'rid':rid}
r = requests.get('http://127.0.0.1:5566/datasets/ROI/'+name,params = payload)
score_list.append(r.json()['ROI'][0]['score'])
score = sum(score_list)
return jsonify({"score":score/size})