<jupyter_start><jupyter_text>2.3.Convert_to_Gray_Scale<jupyter_code># Importamos la librerias
import cv2
import os
image_size = 224 #tamaño de la imagen
label = '200_frente'
path_images_input = 'data_' + str(image_size) + '/validation/' + label + '/'
path_images_output = 'data_' + str(image_size) + '/validation/' + label + '_gray/'
files = os.listdir(path_images_input)
i = 0
j = 0
print("start convert gray color")
print("processing ...")
for file in files:
    try:
        path_image = path_images_input + file
        image = cv2.imread(path_image)
        image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        path_image_output = path_images_output + file
        cv2.imwrite(path_image_output, image)
        i += 1
    except:
        j += 1
        
print("Images created: " + str(i))
print("Images which can not created: " + str(j))<jupyter_output>start convert gray color
processing ...
Images created: 300
Images which can not created: 0
{'fraction_non_alphanumeric': 0.11659663865546219, 'fraction_numerical': 0.023109243697478993, 'mean_word_length': 3.648780487804878, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '390678', 'license': 'MIT', 'n_tokens_mistral': 342, 'n_tokens_neox': 325, 'n_words': 83, 'path': '2.3.Convert_to_Gray_Scale.ipynb', 'repo_name': 'christianquicano/tflite_classification_banknotes', 'size': '952'}