Skip to content

Commit 7d03b3a

Browse files
committed
fix datasets saliency sample bug
1 parent 717645d commit 7d03b3a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/saliency/samples/DeepGaze1Sample.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <opencv2/imgproc.hpp>
77
#include <opencv2/highgui.hpp>
88
#include <opencv2/saliency.hpp>
9-
#include "opencv2/datasets/saliency_mit1003.hpp"
9+
//#include <opencv2/datasets/saliency_mit1003.hpp>
1010
#include <vector>
1111
#include <string>
1212
#include <iostream>
@@ -16,7 +16,7 @@ using namespace std;
1616
using namespace cv;
1717
using namespace cv::dnn;
1818
using namespace cv::saliency;
19-
using namespace cv::datasets;
19+
//using namespace cv::datasets;
2020
/* Find best class for the blob (i. e. class with maximal probability) */
2121

2222
int main()
@@ -29,20 +29,21 @@ int main()
2929
//ALLSTIMULI folder store images
3030
//ALLFIXATIONMAPS foler store training eye fixation
3131
//************ Code only work in linux platform ****
32-
string dataset_path;
32+
33+
/* string dataset_path;
3334
3435
cin >> dataset_path;
3536
Ptr<SALIENCY_mit1003> datasetConnector = SALIENCY_mit1003::create();
3637
datasetConnector->load( dataset_path );
3738
vector<vector<Mat> > dataset( datasetConnector->getDataset() );
3839
39-
//g.training( dataset[0], dataset[1] );
40-
40+
g.training( dataset[0], dataset[1] );
41+
*/
4142
ofstream file;
4243
Mat res2;
43-
g.computeSaliency( dataset[0][0], res2 );
44+
g.computeSaliency( imread( "ALLSTIMULI/i05june05_static_street_boston_p1010764.jpeg"), res2 );
4445
resize( res2, res2, Size( 1024, 768 ) );
45-
cout << "AUC = " << g.computeAUC( res2, dataset[1][0] ) << endl;
46+
cout << "AUC = " << g.computeAUC( res2, imread( "ALLFIXATIONMAPS/i05june05_static_street_boston_p1010764_fixMap.jpg", 0 ) ) << endl;;
4647
g.saliencyMapVisualize( res2 );
4748
file.open( "saliency.csv" );
4849
for ( int i = 0; i < res2.rows; i++)

0 commit comments

Comments
 (0)