Last active
July 9, 2021 14:16
-
-
Save Akash-Rawat/4ba8db73db21a21270a69832f553450d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prep_test_data(med, train_dir, test_dir): | |
pop = os.listdir(train_dir+'/'+med) | |
test_data=random.sample(pop, 2000) | |
print(test_data) | |
for f in test_data: | |
shutil.copy(train_dir+'/'+med+'/'+f, test_dir+'/'+med+'/') | |
for medi in os.listdir(train_dir): | |
prep_test_data(medi, train_dir, test_dir) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment