コード例 #1
0
ファイル: app.py プロジェクト: leo-zhou/cnn_treevis
def json_tree_reconstruction(img_id):
    '''
    Retrieve the reconstruction for a particular path

    # Args
        img_id: Name of image
    '''
    path_id = request.args.get('path_id', None)
    path = get_path(path_id)
    recons = get_vis_tree(net_id, img_id).reconstruction(path)
    return send_img(recons, 'recon_{}.jpg'.format(path_id))
コード例 #2
0
ファイル: app.py プロジェクト: mcogswell/cnn_treevis
def json_tree_reconstruction(img_id):
    '''
    Retrieve the reconstruction for a particular path

    # Args
        img_id: Name of image
    '''
    path_id = request.args.get('path_id', None)
    path = get_path(path_id)
    recons = get_vis_tree(net_id, img_id).reconstruction(path)
    return send_img(recons, 'recon_{}.jpg'.format(path_id))
コード例 #3
0
ファイル: app.py プロジェクト: leo-zhou/cnn_treevis
def json_tree_children(img_id):
    '''
    Retrieve the info of a node's children.

    # Args
        img_id: Name of image
    '''
    path_id = request.args.get('path_id', None)
    path = get_path(path_id)
    tree = get_vis_tree(net_id, img_id)
    children = tree.children_from_path(path)
    for child in children:
        child['path_id'] = get_path_id(child['path'])
    return jsonify({'children': children})
コード例 #4
0
ファイル: app.py プロジェクト: mcogswell/cnn_treevis
def json_tree_children(img_id):
    '''
    Retrieve the info of a node's children.

    # Args
        img_id: Name of image
    '''
    path_id = request.args.get('path_id', None)
    path = get_path(path_id)
    tree = get_vis_tree(net_id, img_id)
    children = tree.children_from_path(path)
    for child in children:
        child['path_id'] = get_path_id(child['path'])
    return jsonify({'children': children})