<commit_before>#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "Utils.hpp"
#include "ShotSegmentation.hpp"
#include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
#include <utility>
#include <algorithm>

using namespace std;
using namespace cv;

vector<Mat> extractVideoHistograms(string videoPath) {
	vector<Mat> histograms;
	Mat frame;
	VideoCapture capture(videoPath);
	
	while(true) {
		bool temp = capture.read(frame);
		if(!temp) {
			break;
		}
		cvtColor(frame,frame,CV_BGR2HSV);
		histograms.push_back(Utils::extractHistogram(frame));
	}
	frame.release();
	capture.release();
	return histograms;	
}

int main(int argc, char* argv[]) {
	if(argc != 3) {
		cout << "Incorrect parameter count. Please, use './FAST <videoFilePath> <outputFilePath>'" << endl;
		return 1;
	}
	string videoPath = string(argv[1]);
	string outputPath = string(argv[2]);
	if(!Utils::checkFile(videoPath)) {
		cout << "The videoFilePath seems to be invalid or cannot be read" << endl;
		return 1;
	}
	if(!Utils::checkOutputFile(outputPath)) {
		cout << "The outputFilePath seems to be invalid or cannot be written" << endl;
		return 1;
	}
	vector<Mat> histograms = extractVideoHistograms(videoPath);
	
	ShotSegmentation ss(histograms, 3, 0.5, 9);
	vector< pair<int,int> > shots = ss.segment();
	
	Utils::writeOutputFile(outputPath, shots);
	return 0;
}<commit_msg>Now the outputFilePath should not exist before using this program<commit_after>#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "Utils.hpp"
#include "ShotSegmentation.hpp"
#include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
#include <utility>
#include <algorithm>

using namespace std;
using namespace cv;

vector<Mat> extractVideoHistograms(string videoPath) {
	vector<Mat> histograms;
	Mat frame;
	VideoCapture capture(videoPath);
	
	while(true) {
		bool temp = capture.read(frame);
		if(!temp) {
			break;
		}
		cvtColor(frame,frame,CV_BGR2HSV);
		histograms.push_back(Utils::extractHistogram(frame));
	}
	frame.release();
	capture.release();
	return histograms;	
}

int main(int argc, char* argv[]) {
	if(argc != 3) {
		cout << "Incorrect parameter count. Please, use './FAST <videoFilePath> <outputFilePath>'" << endl;
		return 1;
	}
	string videoPath = string(argv[1]);
	string outputPath = string(argv[2]);
	if(!Utils::checkFile(videoPath)) {
		cout << "The videoFilePath seems to be invalid or cannot be read" << endl;
		return 1;
	}
	if(Utils::checkFile(outputPath)) {
		cout << "The outputFilePath already exists!" << endl;
		return 1;
	} else {
		if(!Utils::checkOutputFile(outputPath)) {
			cout << "The outputFilePath seems to be invalid or cannot be written" << endl;
			return 1;
		}
	}	
	vector<Mat> histograms = extractVideoHistograms(videoPath);
	
	ShotSegmentation ss(histograms, 3, 0.5, 9);
	vector< pair<int,int> > shots = ss.segment();
	
	Utils::writeOutputFile(outputPath, shots);
	return 0;
}

{'fraction_non_alphanumeric': 0.14201377500819942, 'fraction_numerical': 0.010167267956707117, 'mean_word_length': 5.3146997929606625, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 29, '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': '1143375', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1035, 'n_words': 263}