svm.patch

git diff where questionable conditions will be commented out - Jens Garstka, 2015-07-01 10:32 am

Download (1.5 kB)

 
b/modules/ml/src/svm.cpp
2066 2066
               << "alpha" << "[:";
2067 2067
            fs.writeRaw("d", (const uchar*)&df_alpha[df.ofs], sv_count*sizeof(df_alpha[0]));
2068 2068
            fs << "]";
2069
            if( class_count > 2 )
2070
            {
2069
//            if( class_count > 2 )
2070
//            {
2071 2071
                fs << "index" << "[:";
2072 2072
                fs.writeRaw("i", (const uchar*)&df_index[df.ofs], sv_count*sizeof(df_index[0]));
2073 2073
                fs << "]";
2074
            }
2075
            else
2076
                CV_Assert( sv_count == sv_total );
2074
//            }
2075
//            else
2076
//                CV_Assert( sv_count == sv_total );
2077 2077
            fs << "}";
2078 2078
        }
2079 2079
        fs << "]";
......
2191 2191
            df_index.resize(ofs + sv_count);
2192 2192
            df_alpha.resize(ofs + sv_count);
2193 2193
            dfi["alpha"].readRaw("d", (uchar*)&df_alpha[ofs], sv_count*sizeof(df_alpha[0]));
2194
            if( class_count > 2 )
2194
//            if( class_count > 2 )
2195 2195
                dfi["index"].readRaw("i", (uchar*)&df_index[ofs], sv_count*sizeof(df_index[0]));
2196 2196
            decision_func.push_back(df);
2197 2197
        }
2198
        if( class_count <= 2 )
2199
            setRangeVector(df_index, sv_total);
2198
//        if( class_count <= 2 )
2199
//            setRangeVector(df_index, sv_total);
2200 2200
        if( (int)fn["optimize_linear"] != 0 )
2201 2201
            optimize_linear_svm();
2202 2202
    }