import requests,glob
from timeit import default_timer as timer
import pandas as pd
import operator,tqdm
import numpy as np
import cv2
import shutil

KERAS_REST_API_URL = 'http://104.154.178.63:5000/predict'

def apiCall(url):
    params = (
        ('file',  url),
    )
    response=[]
    try:
        response = requests.get(KERAS_REST_API_URL, params=params)
    except Exception as e:
        print(e)
    # ensure the request was sucessful
    if response:
        return response.content
    # otherwise, the request failed
    else:
        print("Request failed")
        return "Missing Image",0

img = apiCall("https://gcbimages.storage.googleapis.com/segmentation_images/api_segementation/B1B8D028-006D-86DD-7F56-2BC8C9C84CFE/B1B8D028-006D-86DD-7F56-2BC8C9C84CFE_revised_no-bg.png") 