Exemple #1
0
/**********************************************************************************************************************
	Another constructor
**********************************************************************************************************************/
Dataset::Dataset(vector<string> pairedEndFileNames, vector<string> singleEndFileNames, UINT64 minOverlap)
{
	// Initialize the variables.
	numberOfUniqueReads = 0;
	numberOfReads = 0;
	shortestReadLength = 0XFFFFFFFFFFFFFFFF;
	longestReadLength = 0X0000000000000000;
	reads = new vector<Read *>;
	pairedEndDatasetFileNames = pairedEndFileNames;
	singleEndDatasetFileNames = singleEndFileNames;
	minimumOverlapLength = minOverlap;
	UINT64 counter = 0;

	for(UINT64 i = 0; i < pairedEndDatasetFileNames.size(); i++)						// Read the paired-end datasets.
	{
		readDataset(pairedEndDatasetFileNames.at(i), minimumOverlapLength, counter++);
	}

	for(UINT64 i = 0; i < singleEndDatasetFileNames.size(); i++)						// Read the single-end datasets.
	{
		readDataset(singleEndDatasetFileNames.at(i), minimumOverlapLength, counter++);
	}
	cout << endl << "Shortest read length in all datasets: " << setw(5) << shortestReadLength<<endl;
	cout << " Longest read length in all datasets: " << setw(5) << longestReadLength <<endl;;
	sortReads();
	removeDupicateReads();								// Remove duplicated reads for the dataset.
}
Exemple #2
0
int main(int argc, char** argv)
{
    //printf("argc = %d\n", argc);
    //for(int i  = 1; i < argc; i ++)
        //printf("%d %s\n", i, argv[i]);
    
    ParamType p;
    options(argc, argv, p);
    vector<string> files;
    //preprocess
    if(p.algType == 0)
    {
		readDataset(p.videoFile, files);
		preprocess(files);
    }
    //retrieve
    if(p.algType == 1)
    {
    	readDataset(p.videoFile, files);
    	retrive(files);
    }
}
Exemple #3
0
int main(int argc, char** argv)
{
    /////////////////////////////////////////////////////
    ///usage:
    ///AnormalyDetection -t [0 1] [ [-f] or [-d [0 1 2 3...] [-l lable] location] ]
    //AnormalyDetection -t [0 1] -f
    //AnormalyDetection -t [0 1] -d [0 1 2 3...] [-l lable] location
    ///////////////////////////////////////////////////////

    /*printf("argc = %d\n", argc);
    for(int i  = 1; i < argc; i ++)
        printf("%d %s\n", i, argv[i]);*/

    char **output = new char*[4];
    for(int i = 0; i < 4; i ++)
    {
        output[i] = new char[MaxStringLength];
        memcpy(output[i], "\0", MaxStringLength);
    }
    int n = 0;
    if(!options(argc, argv, output, n))
    {
        printf("error usage!\n");
        printf("usage:program options location\n");
        printf("options:-t, -f, -d , -l\n");
        return 1;
    }
    /*for(int i = 0; i < 4; i ++)
    {
        printf("%d: %s\n", i+1, output[i]);
    }*/
    int type = atoi(output[0]);
    if(n == 1)
    {
        if(type == 0)
		{
            trainSVMModel();
		}
		if(type == 1)
		{
		    //printf("entering detection...\n");
            predictSVM();
		}
        return 0;
    }
    
    
    int dataset = atoi(output[1]);
    switch(dataset)
    {
            case 1://UMN
                frameWidth = 320;
    			frameHeight = 240;
    			break;
            case 2://BEHAVE
                frameWidth = 640;
                frameHeight = 480;
    			break;
            case 3://UCSD_PED1
                frameWidth = 238;
                frameHeight = 158;
    			break;
            case 4://UCSD_PED2
                frameWidth = 238;
                frameHeight = 158;
                break;
    		default:
    			break;
    }
    
    char* location = output[2];
	vector<string> files;
    readDataset(location, files);
    
    if(type == 0)
    {
        trainSVMModel(files);
    }
    if(type == 1)
    {
        //printf("entering detection...\n");
        vector<int> labels;
        readLabels(output[3], labels);
        predictSVM(files, labels);
    }

    return 0;
}