Skip to content

About Code Description

cagri edited this page Dec 22, 2019 · 2 revisions

Bag-Of-Word-PyQT-CBIR-system

This project an content base image retrival system. The program is written in python2.7. For environment anaconda has been used. To use program follow those steps:

  1. Dowload anaconda and anaconda-navigator With using navigator download following feautures
    A)Download opencv 2.4.11
    By default navigator does not have opencv 2.4.11 you may use
    conda install -c menpo opencv
    B)Download PyQt5
    C)Download googlesearch
    D)Download google_image_download
    E)Download matplot lib
    2)Configure the macro definitions in begining of code the most important ones described below:
    • SVM_TRAINED_FILE_LOCATION -> the location of bof file you must put exact path of the file in here for ubuntu; cd desktop/testFolder
      pwd
      copy result in SVM_TRAINED_FILE_LOCATION like

    • SVM_TRAINED_FILE_LOCATION="home/user/desktop/testFolder/bof.pkl"

    • SVM_TRAIN_PATH -> the location of train path the program trained by caltech 101 data set which can downloaded in this link. To use SVM_TRAIN_PATH;
      A) create a directory in your local repository which is named train.
      B) Extract caltech101 rar file inside in this directory.
      C) write path name in to SVM_TRAIN_PATH
      for ubuntu;
      first goto directory project exist.
      cd home/user/desktop/testFolder/ after that use following command.
      wget http://www.vision.caltech.edu/Image_Datasets/Caltech101/101_ObjectCategories.tar.gz
      With using wget you will dowload caltech data set into the current folder after that create a directory which is called train and copy the content into it.
      mkdir train
      tar xvzf 101_ObjectCategories.tar.gz -C train/
      mv 101_ObjectCategories/* .
      rm -rf 101_ObjectCategories/
      Get the name of train folder and write down in SVM_TRAIN_PATH for exp ;
      SVM_TRAIN_PATH="home/user/desktop/testFolder/train" To activate code you need do uncomment #trainDataSet() method by removing "#" sign. The program test each class and give you some logs on console screen after that it publish a histogram like above.

    • GOOGLE_GIMAGE_OUTPUT_PATH -> This folder needen when a SVM prediction done. After prediction program downloads images on this path temporarily for retrival process.

    • GOOGLE_GIMAGE_COUNT -> This is for to adjust how many image will be dowloaded according to svm prediction

    • GOOGLE_URL_COUNT -> This is for number of url which showed on gui to user from the svm prediction

    • SVM_TEST_PATH -> to test path user need to follow same precedure as to "SVM_TRAIN_PATH". To test data set we used caltecth101 data set and we devided sets into 3 part which has higher rate from seventy percent lover than ten percent and avarage about forty procent.which are showed below:

    Around below 10 percent succes rate:

testBelov10

Around 40 percent succes rate:

testAround40

Above 70 percent:

testAbov70