Exemple #1
0
  public void testIndexWang() throws IOException {
    // indexing
    System.out.println("-< Getting files to index >--------------");
    parallelIndexer.run();
    //        ArrayList<String> images = FileUtils.getAllImages(new File(testExtensive), true);
    //        System.out.println("-< Indexing " + images.size() + " files >--------------");
    //        indexFiles(images, builder, indexPath);
    //        in case of sift ...
    //        SiftFeatureHistogramBuilder sh1 = new
    // SiftFeatureHistogramBuilder(IndexReader.open(FSDirectory.open(new File(indexPath))), 200,
    // 8000);
    //        sh1.index();
    //        SurfFeatureHistogramBuilder sh = new
    // SurfFeatureHistogramBuilder(DirectoryReader.open(FSDirectory.open(new File(indexPath))),800,
    // 1000);
    //        sh.setProgressMonitor(new ProgressMonitor(null, "", "", 0, 100));
    //        sh.index();
    //        MSERFeatureHistogramBuilder sh2 = new
    // MSERFeatureHistogramBuilder(IndexReader.open(FSDirectory.open(new File(indexPath))), 200,
    // 8000);
    //        sh2.index();

    System.out.println("-< Indexing finished >--------------");
    //        System.out.println("SiftFeatureHistogramBuilder sh1 = new
    // SiftFeatureHistogramBuilder(IndexReader.open(FSDirectory.open(new File(indexPath))), 200,
    // 1000);");
    // testMAP();
  }
 public void testIndexing() throws Exception {
   // index data
   ParallelIndexer pin =
       new ParallelIndexer(16, indexPath, dataSet, true) {
         @Override
         public void addBuilders(ChainedDocumentBuilder builder) {
           for (int i = 0; i < testFeatures.length; i++) {
             builder.addBuilder(new GenericDocumentBuilder(testFeatures[i], false));
           }
         }
       };
   pin.run();
   // index answers
   pin =
       new ParallelIndexer(16, indexPath, answerSet, false) {
         @Override
         public void addBuilders(ChainedDocumentBuilder builder) {
           for (int i = 0; i < testFeatures.length; i++) {
             builder.addBuilder(new GenericDocumentBuilder(testFeatures[i], false));
           }
         }
       };
   pin.run();
 }