Download apps/traincascade/old_ml_precomp.hpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 20.3 kB
-
https://huggingface.co/tgollogly/test/resolve/main/apps/traincascade/old_ml_precomp.hpp
- Command line
-
hf download hf://tgollogly/test/apps/traincascade/old_ml_precomp.hpp
-
curl -L -o old_ml_precomp.hpp https://huggingface.co/tgollogly/test/resolve/main/apps/traincascade/old_ml_precomp.hpp
20.3 kB
| /*M/////////////////////////////////////////////////////////////////////////////////////// | |
| // | |
| // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. | |
| // | |
| // By downloading, copying, installing or using the software you agree to this license. | |
| // If you do not agree to this license, do not download, install, | |
| // copy or use the software. | |
| // | |
| // | |
| // Intel License Agreement | |
| // | |
| // Copyright (C) 2000, Intel Corporation, all rights reserved. | |
| // Third party copyrights are property of their respective owners. | |
| // | |
| // Redistribution and use in source and binary forms, with or without modification, | |
| // are permitted provided that the following conditions are met: | |
| // | |
| // * Redistribution's of source code must retain the above copyright notice, | |
| // this list of conditions and the following disclaimer. | |
| // | |
| // * Redistribution's in binary form must reproduce the above copyright notice, | |
| // this list of conditions and the following disclaimer in the documentation | |
| // and/or other materials provided with the distribution. | |
| // | |
| // * The name of Intel Corporation may not be used to endorse or promote products | |
| // derived from this software without specific prior written permission. | |
| // | |
| // This software is provided by the copyright holders and contributors "as is" and | |
| // any express or implied warranties, including, but not limited to, the implied | |
| // warranties of merchantability and fitness for a particular purpose are disclaimed. | |
| // In no event shall the Intel Corporation or contributors be liable for any direct, | |
| // indirect, incidental, special, exemplary, or consequential damages | |
| // (including, but not limited to, procurement of substitute goods or services; | |
| // loss of use, data, or profits; or business interruption) however caused | |
| // and on any theory of liability, whether in contract, strict liability, | |
| // or tort (including negligence or otherwise) arising in any way out of | |
| // the use of this software, even if advised of the possibility of such damage. | |
| // | |
| //M*/ | |
| /* Convert matrix to vector */ | |
| /* get raw data */ | |
| /* | |
| uchar* data; int sstep, cstep; - trainData->data | |
| uchar* classes; int clstep; int ncl;- trainClasses | |
| uchar* tmask; int tmstep; int ntm; - typeMask | |
| uchar* missed;int msstep, mcstep; -missedMeasurements... | |
| int mm, mn; == m,n == size,dim | |
| uchar* sidx;int sistep; - sampleIdx | |
| uchar* cidx;int cistep; - compIdx | |
| int k, l; == n,m == dim,size (length of cidx, sidx) | |
| int m, n; == size,dim | |
| */ | |
| /****************************************************************************************/ | |
| /****************************************************************************************\ | |
| * Auxiliary functions declarations * | |
| \****************************************************************************************/ | |
| /* Generates a set of classes centers in quantity <num_of_clusters> that are generated as | |
| uniform random vectors in parallelepiped, where <data> is concentrated. Vectors in | |
| <data> should have horizontal orientation. If <centers> != NULL, the function doesn't | |
| allocate any memory and stores generated centers in <centers>, returns <centers>. | |
| If <centers> == NULL, the function allocates memory and creates the matrice. Centers | |
| are supposed to be oriented horizontally. */ | |
| CvMat* icvGenerateRandomClusterCenters( int seed, | |
| const CvMat* data, | |
| int num_of_clusters, | |
| CvMat* centers CV_DEFAULT(0)); | |
| /* Fills the <labels> using <probs> by choosing the maximal probability. Outliers are | |
| fixed by <oulier_tresh> and have cluster label (-1). Function also controls that there | |
| weren't "empty" clusters by filling empty clusters with the maximal probability vector. | |
| If probs_sums != NULL, fills it with the sums of probabilities for each sample (it is | |
| useful for normalizing probabilities' matrice of FCM) */ | |
| void icvFindClusterLabels( const CvMat* probs, float outlier_thresh, float r, | |
| const CvMat* labels ); | |
| typedef struct CvSparseVecElem32f | |
| { | |
| int idx; | |
| float val; | |
| } | |
| CvSparseVecElem32f; | |
| /* Prepare training data and related parameters */ | |
| int | |
| cvPrepareTrainData( const char* /*funcname*/, | |
| const CvMat* train_data, int tflag, | |
| const CvMat* responses, int response_type, | |
| const CvMat* var_idx, | |
| const CvMat* sample_idx, | |
| bool always_copy_data, | |
| const float*** out_train_samples, | |
| int* _sample_count, | |
| int* _var_count, | |
| int* _var_all, | |
| CvMat** out_responses, | |
| CvMat** out_response_map, | |
| CvMat** out_var_idx, | |
| CvMat** out_sample_idx=0 ); | |
| void | |
| cvSortSamplesByClasses( const float** samples, const CvMat* classes, | |
| int* class_ranges, const uchar** mask CV_DEFAULT(0) ); | |
| void | |
| cvCombineResponseMaps (CvMat* _responses, | |
| const CvMat* old_response_map, | |
| CvMat* new_response_map, | |
| CvMat** out_response_map); | |
| void | |
| cvPreparePredictData( const CvArr* sample, int dims_all, const CvMat* comp_idx, | |
| int class_count, const CvMat* prob, float** row_sample, | |
| int as_sparse CV_DEFAULT(0) ); | |
| /* copies clustering [or batch "predict"] results | |
| (labels and/or centers and/or probs) back to the output arrays */ | |
| void | |
| cvWritebackLabels( const CvMat* labels, CvMat* dst_labels, | |
| const CvMat* centers, CvMat* dst_centers, | |
| const CvMat* probs, CvMat* dst_probs, | |
| const CvMat* sample_idx, int samples_all, | |
| const CvMat* comp_idx, int dims_all ); | |
| cv::FileNode icvFileNodeGetChild( cv::FileNode& father, const char* name ); | |
| cv::FileNode icvFileNodeGetChildArrayElem( cv::FileNode& father, const char* name,int index ); | |
| cv::FileNode icvFileNodeGetNext( cv::FileNode& n, const char* name ); | |
| void cvCheckTrainData( const CvMat* train_data, int tflag, | |
| const CvMat* missing_mask, | |
| int* var_all, int* sample_all ); | |
| CvMat* cvPreprocessIndexArray( const CvMat* idx_arr, int data_arr_size, bool check_for_duplicates=false ); | |
| CvMat* cvPreprocessVarType( const CvMat* type_mask, const CvMat* var_idx, | |
| int var_all, int* response_type ); | |
| CvMat* cvPreprocessOrderedResponses( const CvMat* responses, | |
| const CvMat* sample_idx, int sample_all ); | |
| CvMat* cvPreprocessCategoricalResponses( const CvMat* responses, | |
| const CvMat* sample_idx, int sample_all, | |
| CvMat** out_response_map, CvMat** class_counts=0 ); | |
| const float** cvGetTrainSamples( const CvMat* train_data, int tflag, | |
| const CvMat* var_idx, const CvMat* sample_idx, | |
| int* _var_count, int* _sample_count, | |
| bool always_copy_data=false ); | |
| namespace cv | |
| { | |
| struct DTreeBestSplitFinder | |
| { | |
| DTreeBestSplitFinder(){ splitSize = 0, tree = 0; node = 0; } | |
| DTreeBestSplitFinder( CvDTree* _tree, CvDTreeNode* _node); | |
| DTreeBestSplitFinder( const DTreeBestSplitFinder& finder, Split ); | |
| virtual ~DTreeBestSplitFinder() {} | |
| virtual void operator()(const BlockedRange& range); | |
| void join( DTreeBestSplitFinder& rhs ); | |
| Ptr<CvDTreeSplit> bestSplit; | |
| Ptr<CvDTreeSplit> split; | |
| int splitSize; | |
| CvDTree* tree; | |
| CvDTreeNode* node; | |
| }; | |
| struct ForestTreeBestSplitFinder : DTreeBestSplitFinder | |
| { | |
| ForestTreeBestSplitFinder() : DTreeBestSplitFinder() {} | |
| ForestTreeBestSplitFinder( CvForestTree* _tree, CvDTreeNode* _node ); | |
| ForestTreeBestSplitFinder( const ForestTreeBestSplitFinder& finder, Split ); | |
| virtual void operator()(const BlockedRange& range); | |
| }; | |
| } | |