Add JSON support.

a JSON emitter, a parser, tests and some basic doc.
This commit is contained in:
MYLS
2016-08-11 00:53:15 +08:00
parent 26a8c45e23
commit 8596e82d98
7 changed files with 1151 additions and 139 deletions
+3 -3
View File
@@ -64,11 +64,11 @@ int CV_SLMLTest::run_test_case( int testCaseIdx )
if( code == cvtest::TS::OK )
{
get_test_error( testCaseIdx, &test_resps1 );
fname1 = tempfile(".yml.gz");
fname1 = tempfile(".json.gz");
save( (fname1 + "?base64").c_str() );
load( fname1.c_str() );
get_test_error( testCaseIdx, &test_resps2 );
fname2 = tempfile(".yml.gz");
fname2 = tempfile(".json.gz");
save( (fname2 + "?base64").c_str() );
}
else
@@ -279,7 +279,7 @@ TEST(DISABLED_ML_SVM, linear_save_load)
svm1 = Algorithm::load<SVM>("SVM45_X_38-1.xml");
svm2 = Algorithm::load<SVM>("SVM45_X_38-2.xml");
string tname = tempfile("a.xml");
string tname = tempfile("a.json");
svm2->save(tname + "?base64");
svm3 = Algorithm::load<SVM>(tname);