WangGodder / deep-cross-modal-hashing

Deep learning cross modal hashing in PyTorch
MIT License
102 stars 25 forks source link
cross-modal-hashing data-visualization dataset pytorch

deep cross modal hashing (torchcmh)

Chinese readme

torchcmh is a library built on PyTorch for deep learning cross modal hashing.\ Including:

There are four datasets(Mirflickr25k, Nus Wide, MS coco, IAPR TC-12) sort out by myself, if you want use these datasets, please download mat file and image file by readme file in dataset package.\ Please read "readme" in dataset package


Model

You can crate model or use existing model. We support some pre-train models, you can check out the README.md file in details.


Dependencies

you need to install these package to run

All method training will create a log and checkpoint to store the model. \ you can find log in ./logs/{method_name}/{dataset_name}/date.txt \ you can find checkpoints in ./checkpoints/{method_name}/{dataset_name}/{bit}-{model_name}.pth


How to using

- run ./script/main.py and input configuration file path.
```python
from torchcmh.run import run
if __name__ == '__main__':
    run(config_path='default_config.yml')

How to create your method

A easy way to create your method

run script create_algorithm.py as following:

python create_algorithm.py ${method_name}

You can assign the method name by command or in create_algorithm.py

After running create_algorithm.py, you should get a new python file with your method name in "torchcmh/training/". And you should also get a directory with your method name in "torchcmh/models".

Finish your algorithm and run it.

some function in TrainBase