Beispiel #1
0
def load_higgs():
    url = "http://opendata.cern.ch/record/328/files/atlas-higgs-challenge-2014-v2.csv.gz"
    filename = os.path.join(get_data_dir(),
                            "atlas-higgs-challenge-2014-v2.csv.gz")
    maybe_download(filename, url)
    data = pd.read_csv(filename)
    return data
Beispiel #2
0
def invoke(body):
    # print(tf.__version__)
    #print(body)

    # Download Inception model if not already done.
    maybe_download()

    # Load the Inception model so it is ready for classifying images.
    model = Inception()

    image_path = download.maybe_download(body, data_dir)
    # Path for a jpeg-image that is included in the downloaded data.
    # image_path = os.path.join(data_dir, 'cropped_panda.jpg')

    # Use the Inception model to classify the image.
    pred = model.classify(image_path=image_path)

    # Print the scores and names for the top-10 predictions.
    res = json.dumps(model.print_scores(pred=pred, k=5))

    # Close the TensorFlow session.
    model.close()

    # Transfer Learning is demonstrated in Tutorial #08.
    return res
Beispiel #3
0
def download_data():
    download.maybe_download_and_extract(url=data_url, download_dir=data_path)
    download.maybe_download(url=mat_url, download_dir=data_path)