예제 #1
0
파일: images.py 프로젝트: zpace/marvin
def get_random_images(num, release=None, download=None):
    ''' Get a random set of Images

    Gets a random set of Marvin Images.  Optionally can download them
    in bulk.

    Parameters:
        num (int):
            The number of random images to grab
        download (bool):
            If True, also downloads all the images locally
        release (str):
            The release of the data to grab images for

    Returns:
        A list of Marvin Images

    '''

    from marvin.tools.image import Image

    images = Image.get_random(num=num, release=release)

    if download:
        _download_images(images, label='by_random')

    return images
예제 #2
0
파일: test_image.py 프로젝트: rgcl/marvin
 def test_getrandom(self):
     images = Image.get_random(2)
     assert len(images) == 2