<jupyter_start><jupyter_text>Form a testing and training directory<jupyter_code>"""

Set to file path where the AP or PA directories are located

For example, if your directory looks like '/Users/akshatchannashetti/Downloads/train/AP/normal', then set the path to '/Users/akshatchannashetti/Downloads/train/AP'

You will have to run this JN again for every orientation (AP, PA, L)

"""

TRAINING_DIRECTORY = '/Users/akshatchannashetti/Downloads/train/AP'
TESTING_DIRECTORY = '/Users/akshatchannashetti/Downloads/test/AP'

### If your subfolder names are not the ones below, change them here
NORMAL_FOLDER_NAME = 'normal'
ABNORMAL_FOLDER_NAME = 'abnormal'<jupyter_output><empty_output><jupyter_text>Balanced Augmentation<jupyter_code>num_of_images = 0

if len(os.listdir(os.path.join(TRAINING_DIRECTORY, ABNORMAL_FOLDER_NAME))) > len(os.listdir(os.path.join(TRAINING_DIRECTORY,NORMAL_FOLDER_NAME))):
    num_of_images = len(os.listdir(os.path.join(TRAINING_DIRECTORY, ABNORMAL_FOLDER_NAME))) - len(os.listdir(os.path.join(TRAINING_DIRECTORY, NORMAL_FOLDER_NAME)))
    AugmentationPipeline.augmentation_pipeline(os.path.join(TRAINING_DIRECTORY, NORMAL_FOLDER_NAME), num_of_images)
else:
    num_of_images = len(os.listdir(os.path.join(TRAINING_DIRECTORY, NORMAL_FOLDER_NAME))) - len(os.listdir(os.path.join(TRAINING_DIRECTORY, ABNORMAL_FOLDER_NAME)))
    AugmentationPipeline.augmentation_pipeline(os.path.join(TRAINING_DIRECTORY, ABNORMAL_FOLDER_NAME), num_of_images)
print(len(os.listdir(os.path.join(TRAINING_DIRECTORY, NORMAL_FOLDER_NAME))))
print(len(os.listdir(os.path.join(TRAINING_DIRECTORY, ABNORMAL_FOLDER_NAME))))<jupyter_output>27047
27047
{'fraction_non_alphanumeric': 0.10855063674954518, 'fraction_numerical': 0.0066707095209217705, 'mean_word_length': 8.065934065934066, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '617000', 'license': 'MIT', 'n_tokens_mistral': 627, 'n_tokens_neox': 618, 'n_words': 94, 'path': 'datasetsforeverything/BinaryAugmentation.ipynb', 'repo_name': 'akshat2048/MSOE_ML', 'size': '1649'}