()
Loads the validation data set including X and study ids and saves it to .npy file.
Loads the validation data set including X and study ids and saves it to .npy file.
Loads the validation data set including X and study ids and saves it to . npy file .
def write_validation_npy():
    """
    Loads the validation data set including X and study ids and saves it to .npy file.
    """
    print('-'*50)
    print('Writing validation data to .npy file...')
    print('-'*50)

    ids, images = load_images('data/validate')
    study_ids = []
    X = []

    for study_id in ids:
        study = images[study_id]
        for i in range(study.shape[0]):
            study_ids.append(study_id)
            X.append(study[i, :, :, :])

    X = np.array(X, dtype=np.uint8)
    np.save('data/X_validate.npy', X)
    np.save('data/ids_validate.npy', study_ids)
    print('Done.')
def write_validation_npy ( ) : print ( '-' * 50 ) print ( 'Writing validation data to .npy file...' ) print ( '-' * 50 ) ids , images = load_images ( 'data/validate' ) study_ids = [ ] X = [ ] for study_id in ids : study = images [ study_id ] for i in range ( study . shape [ 0 ] ) : study_ids . append ( study_id ) X . append ( study [ i , : , : , : ] ) X = np . array ( X , dtype = np . uint8 ) np . save ( 'data/X_validate.npy' , X ) np . save ( 'data/ids_validate.npy' , study_ids ) print ( 'Done.' )