Let me show you how to use the code.
It can divided to two parts.
When you clone the repository, it will look like this:
├── src/ # Source files
├── result/ # Results
├── USAGE.md # How to use the code
└── README.md # Intro to the repo
you need to add your images into a directory called database/, so it will look like this:
├── src/ # Source files
├── result/ # Results
├── USAGE.md # How to use the code
├── README.md # Intro to the repo
└── database/ # Directory of all your images
all your image should put into database/
In this directory, each image class should have its own directory
see the picture for details:
In my database, there are 25 classes, each class has its own directory,
and the images belong to this class should put into this directory.
I implement several algorithm, you can run it with python3.
python3 src/color.py
python3 src/daisy.py
python3 src/gabor.py
python3 src/edge.py
python3 src/HOG.py
You need to install pytorch0.2 to run the code
python3 src/vggnet.py
You need to install pytorch0.2 to run the code
python3 src/resnet.py
Above are basic usage of my codes.
There are some advanced issue such as features fusion and dimension reduction,
the intro of these parts will be written further in the future :D
I implement the basic feature fusion method -- concatenation.
Codes for feature fusion is written in fusion.py
In fusion.py, there is a class called FeatureFusion.
You can create a FeatureFusion instance with an argument called features.
For example, in fusion.py line140
fusion = FeatureFusion(features=['color', 'daisy'])
APs = evaluate_class(db, f_instance=fusion, d_type=d_type, depth=depth)
- The first line means to concatenate color featrue and daisy feature.
- The second line means to evaluate with the concatenated feature.
If you want to know the performance of all possible feature combination, look at fusion.py line122 for example
evaluate_feats(db, N=2, d_type='d1')
- Parameter N means how many feature you want to concatenate.
- Parameter d_type means the distance metric you want to use.
- Function evaluate_feats will generate a result file that record performances for all feature concatenation.
Po-Chih Huang / @pochih