<jupyter_start><jupyter_text>Preprocess data  Insert image train/validation data to `data/train` and `data/val` folders respectively  Convert every image to `.jpeg` format (for tfrecord decode error prevention)<jupyter_code>!python preprocess/to_jpeg.py --folderPath data/train
!python preprocess/to_jpeg.py --folderPath data/val<jupyter_output><empty_output><jupyter_text>Generate `.csv` file of annotations for each object on each image<jupyter_code>!python preprocess/xml_to_csv.py -i data/train -o data/train_labels.csv
!python preprocess/xml_to_csv.py -i data/val -o data/val_labels.csv<jupyter_output><empty_output><jupyter_text>Generate `.tfrecord` files for tran/validation data to be fed into a model<jupyter_code>!python preprocess/facemask_tfrecord.py --output_file data/facemask_val.tfrecord --classes data/facemask.names --data_path data/val --csv_path data/val_labels.csv
!python preprocess/facemask_tfrecord.py --output_file data/facemask_train.tfrecord --classes data/facemask.names --data_path data/train --csv_path data/train_labels.csv<jupyter_output><empty_output><jupyter_text>Modelling/Training  Download tiny-YOLO pretrained weights and transform to `.tf` format<jupyter_code>!wget https://pjreddie.com/media/files/yolov3-tiny.weights -O data/yolov3-tiny.weights
!python convert.py --weights ./data/yolov3-tiny.weights --output ./checkpoints/face_mask_detection.tf --tiny<jupyter_output><empty_output><jupyter_text>Training parameters--dataset `.tfrecord` dataset path for train set--val_dataset `.tfrecord` dataset path for validation set--weights `Tiny YOLO model weights path`--classes File path containing class names --transfer transfer type (for transfer learning with different output shape we need 'darknet')--epochs Number of epochs--num_classes Number of classes in our model--weights_num_classes Number of classes of model that we're transfering weights from--tiny True/False whether we use tiny version of YOLO or not<jupyter_code>!python train.py --dataset data/facemask_train.tfrecord --val_dataset data/facemask_val.tfrecord \
    --weights checkpoints/face_mask_detection.tf --classes data/facemask.names --mode fit \
    --transfer darknet --epochs 20 --num_classes 2 --weights_num_classes 80 --tiny True<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09894459102902374, 'fraction_numerical': 0.003518029903254178, 'mean_word_length': 5.556195965417867, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '117582', 'license': 'MIT', 'n_tokens_mistral': 719, 'n_tokens_neox': 704, 'n_words': 186, 'path': 'Training.ipynb', 'repo_name': 'Prelysium/facemask-modelling', 'size': '2274'}