Beispiel #1
0
def GetImageData(id=61512):
    """
    Get data about an image.
    """
    data = utils.RetrieveData('/api/v0/images/' + str(id))
    if 'detail' in data and data['detail'] == 'Not found.':
        return None
    image = utils.ParseImageData(data)
    return image
Beispiel #2
0
def GetAllImageData(dataDir=None):
    """
    Get Image ids from startIndex to endIndex.
    """

    if dataDir is None:
        dataDir = utils.GetDataDir()
    dataFile = os.path.join(dataDir, 'image_data.json')
    data = json.load(open(dataFile))
    return [utils.ParseImageData(image) for image in data]
Beispiel #3
0
def GetAllImageData(dataDir=None):
  if dataDir is None:
    dataDir = utils.GetDataDir()
  dataFile = os.path.join(dataDir, 'image_data.json')
  data = json.load(open(dataFile))
  return [utils.ParseImageData(image) for image in data]