main.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:video_annotation 作者: danoneata 项目源码 文件源码
def get_annotation():
    annotation_id = request.form["annotation_id"]
    annotation = Annotation.query.filter(Annotation.id == annotation_id).first()
    #pdb.set_trace();
    if annotation.keywords_therapist =='':
       selected_therapist  = ''
    else:
       selected_therapist = [str(WORD_TO_ID_THERAPIST[k]) for k in annotation.keywords_therapist.split(", ")]

    if annotation.keywords_child =='':
       selected_child  = ''
    else:
       selected_child = [str(WORD_TO_ID_CHILD[k]) for k in annotation.keywords_child.split(", ")]

    return jsonify({
        "t_start": annotation.start_frame / FPS,
        "t_end": annotation.end_frame / FPS,
        "description": annotation.description,
        "selected_vocab_child": selected_child,
        "selected_vocab_therapist": selected_therapist,
        "description_type":annotation.description_type,
    })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号