<commit_before>#include <iostream>
#include <string>
#include "facenet_tf.h"
using namespace std;

int main (int argc, char *argv[]) {
	if (argc < 7) {
		cout << "Usage:\n"
						"./facenet_classify <TRAIN|CLASSIFY>  <Path/To/TensorFlowModel> <Path/To/Image/Directory/Structure> <Path/To/SVM/Model> <SVM/Class/Labels> <SVM|KNN|MLP>\n"
						"Directory structure should be <class_name>/<image_files>\n"
						"Face Images Should be 160x160\n" << endl;
		return 1;
	}
	string operation, images_path, model_path, svm_model_path, labels_file_path, ml_type;
	operation = string (argv[1]);
	model_path = string (argv[2]);
	images_path = string (argv[3]);
	svm_model_path = string (argv[4]);
	labels_file_path = string (argv[5]);
	ml_type = string (argv[6]); //SVM or KNN or MLP
	FacenetClassifier classifier = FacenetClassifier (operation, model_path, svm_model_path, labels_file_path);
	classifier.parse_images_path (images_path, 0);
	classifier.create_input_tensor ();
	classifier.create_phase_tensor ();
	classifier.run ();
	
	if (ml_type == "SVM") {
		if (operation == "TRAIN") {
			classifier.save_svm ();
			classifier.save_labels ();
		}
		else if (operation == "CLASSIFY") {	
			classifier.load_svm ();
			classifier.load_labels ();
			classifier.predict_labels ();
		}
	}
	else if (ml_type == "KNN") {
		if (operation == "TRAIN") {
			classifier.save_knn ();
			classifier.save_labels ();
		}
		else if (operation == "CLASSIFY") {
			classifier.load_labels ();
			classifier.load_knn ();
			classifier.predict_knn_labels ();
		}
	}<commit_msg>Preprocess Added to Input Mats<commit_after>#include <iostream>
#include <string>
#include "facenet_tf.h"
using namespace std;

int main (int argc, char *argv[]) {
	if (argc < 7) {
		cout << "Usage:\n"
						"./facenet_classify <TRAIN|CLASSIFY>  <Path/To/TensorFlowModel> <Path/To/Image/Directory/Structure> <Path/To/SVM/Model> <SVM/Class/Labels> <SVM|KNN|MLP>\n"
						"Directory structure should be <class_name>/<image_files>\n"
						"Face Images Should be 160x160\n" << endl;
		return 1;
	}
	string operation, images_path, model_path, svm_model_path, labels_file_path, ml_type;
	operation = string (argv[1]);
	model_path = string (argv[2]);
	images_path = string (argv[3]);
	svm_model_path = string (argv[4]);
	labels_file_path = string (argv[5]);
	ml_type = string (argv[6]); //SVM or KNN or MLP
	FacenetClassifier classifier = FacenetClassifier (operation, model_path, svm_model_path, labels_file_path);
	classifier.parse_images_path (images_path, 0);
	classifier.preprocess_input_mat ();
	classifier.create_input_tensor ();
	classifier.create_phase_tensor ();
	classifier.run ();
	
	if (ml_type == "SVM") {
		if (operation == "TRAIN") {
			classifier.save_svm ();
			classifier.save_labels ();
		}
		else if (operation == "CLASSIFY") {	
			classifier.load_svm ();
			classifier.load_labels ();
			classifier.predict_labels ();
		}
	}
	else if (ml_type == "KNN") {
		if (operation == "TRAIN") {
			classifier.save_knn ();
			classifier.save_labels ();
		}
		else if (operation == "CLASSIFY") {
			classifier.load_labels ();
			classifier.load_knn ();
			classifier.predict_knn_labels ();
		}
	}
{'fraction_non_alphanumeric': 0.15003178639542275, 'fraction_numerical': 0.009535918626827717, 'mean_word_length': 4.47304347826087, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 23, '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}}
{'dir': 'git-commits-cleaned', 'id': '5348671', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1142, 'n_words': 233}