dog_breeds_web_app/util.py
def save_cropped_imgs(num, cropped_imgs):
    """
    Save cropped images to temp directory for later use
    Parameters:
        cropped_imgs: cropped images with detected faces
        num: number of cropped images from a test image
    Return:
        cropped_img_path: a string-valued file path to a cropped image
    """
    dirName = 'static/tempDir'
    if not os.path.exists(dirName):
        os.mkdir(dirName)
    n = random.randint(0, 30000) #force a web browser NOT to cache images
    cropped_img_path =  dirName + '/img' + str(n) + '.jpg'
    cv2.imwrite(cropped_img_path, cropped_imgs[num])
    return cropped_img_path

    Save cropped images to temp directory for later use
    Parameters:
        cropped_imgs: cropped images with detected faces
        num: number of cropped images from a test image
    Return:
        cropped_img_path: a string-valued file path to a cropped image
    
Save cropped images to temp directory for later use
Save cropped images to temp directory for later use
def save_cropped_imgs(num, cropped_imgs):
    dirName = 'static/tempDir'
    if not os.path.exists(dirName):
        os.mkdir(dirName)
    n = random.randint(0, 30000) 
    cropped_img_path =  dirName + '/img' + str(n) + '.jpg'
    cv2.imwrite(cropped_img_path, cropped_imgs[num])
    return cropped_img_path
def save_cropped_imgs ( num , cropped_imgs ) : dirName = 'static/tempDir' if not os . path . exists ( dirName ) : os . mkdir ( dirName ) n = random . randint ( 0 , 30000 ) cropped_img_path = dirName + '/img' + str ( n ) + '.jpg' cv2 . imwrite ( cropped_img_path , cropped_imgs [ num ] ) return cropped_img_path
Save cropped images to temp directory for later use
Save cropped images to temp directory for later use
"""
    Save cropped images to temp directory for later use
    Parameters:
        cropped_imgs: cropped images with detected faces
        num: number of cropped images from a test image
    Return:
        cropped_img_path: a string-valued file path to a cropped image
    """ #force a web browser NOT to cache images
num
number of cropped images from a test image
number of cropped images from a test image
cropped_imgs
cropped images with detected faces
cropped images with detected faces