예제 #1
0
def get_scene_graph_of_image(id=2001):
    """
    Get Scene Graph of an image.
    """
    image = get_image_data(id=id)
    data = utils.retrieve_data('/api/v0/images/' + str(id) + '/graph')
    if 'detail' in data and data['detail'] == 'Not found.':
        return None
    return utils.parse_graph(data, image)
예제 #2
0
def get_scene_graph_of_image(id=61512):
    """
    Get Scene Graph of an image.
    """
    image = get_image_data(id=id)
    data = utils.retrieve_data("/api/v0/images/" + str(id) + "/graph")
    if "detail" in data and data["detail"] == "Not found.":
        return None
    return utils.parse_graph(data, image)
예제 #3
0
파일: api.py 프로젝트: liuguoyou/who_where
def get_scene_graph_of_image(id=61512):
    """
    Get Scene Graph of an image.
    """
    image = get_image_data(id=id)
    data = utils.retrieve_data('/api/v0/images/' + str(id) + '/graph')
    if 'detail' in data and data['detail'] == 'Not found.':
        return None
    return utils.parse_graph(data, image)
예제 #4
0
def get_region_graph_of_region(image_id=61512, region_id=1):
    """
    Get Region Graph of a particular Region in an image.
    """
    image = get_image_data(id=image_id)
    data = utils.retrieve_data("/api/v0/images/" + str(image_id) +
                               "/regions/" + str(region_id))
    if "detail" in data and data["detail"] == "Not found.":
        return None
    return utils.parse_graph(data[0], image)
예제 #5
0
파일: api.py 프로젝트: wuguowuge/who_where
def get_region_graph_of_region(image_id=61512, region_id=1):
    """
    Get Region Graph of a particular Region in an image.
    """
    image = get_image_data(id=image_id)
    data = utils.retrieve_data('/api/v0/images/' + str(image_id) +
                               '/regions/' + str(region_id))
    if 'detail' in data and data['detail'] == 'Not found.':
        return None
    return utils.parse_graph(data[0], image)
예제 #6
0
파일: api.py 프로젝트: liuguoyou/who_where
def get_region_graph_of_region(image_id=61512, region_id=1):
    """
    Get Region Graph of a particular Region in an image.
    """
    image = get_image_data(id=image_id)
    data = utils.retrieve_data(
        '/api/v0/images/' + str(image_id) + '/regions/' + str(region_id))
    if 'detail' in data and data['detail'] == 'Not found.':
        return None
    return utils.parse_graph(data[0], image)