<jupyter_start><jupyter_text>Copy images from images folder to training folder for face alignment<jupyter_code>import os
from tqdm import tqdm_notebook
from shutil import copyfile
PATH = '../../data/dogfacenet/images/'
PATH_dest = '../../data/dogfacenet/aligned/before_2/'
PATH_valid = '../../data/dogfacenet/validation/'<jupyter_output><empty_output><jupyter_text>Copy files from images folder to training folder<jupyter_code>count_classes = 0
mean = 0.

for root,dirs,files in tqdm_notebook(os.walk(PATH)):
    if len(files) > 4:
        idx = -1
        for i in range(-1,-len(root),-1):
            if root[i] == '/':
                idx = i+1
                break
        for i in range(len(files)):
            copyfile(root+'/'+files[i],PATH_dest+root[idx:]+'.'+files[i])

        count_classes += 1
        mean += len(files)

print("Number of classes: " + str(count_classes))
print("Mean number of images per classes: " + str(mean/count_classes))
count_classes = 0
mean = 0.

for root,dirs,files in tqdm_notebook(os.walk(PATH)):
    if len(files) > 0 and len(files) <= 4:
        idx = -1
        for i in range(-1,-len(root),-1):
            if root[i] == '/':
                idx = i+1
                break
        for i in range(len(files)):
            copyfile(root+'/'+files[i],PATH_valid+root[idx:]+'.'+files[i])

        count_classes += 1
        mean += len(files)

print("Number of classes: " + str(count_classes))
print("Mean number of images per classes: " + str(mean/count_classes))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15029277813923228, 'fraction_numerical': 0.011711125569290826, 'mean_word_length': 2.8163771712158807, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '475196', 'license': 'MIT', 'n_tokens_mistral': 527, 'n_tokens_neox': 512, 'n_words': 119, 'path': 'dogfacenet-dev/labelizer/copy_images.ipynb', 'repo_name': 'angellmethod/DogFaceNet', 'size': '1537'}