vonclites / cogan

1 stars 0 forks source link

cogan Modules are missing #7

Open liang5211314 opened 1 week ago

liang5211314 commented 1 week ago

Hello, I read your paper Synthesis-Guided Feature Learning for Cross-Spectral Periocular Recognition and found the corresponding code, but when reproducing the code, it seems that the code is missing the cogan module, e.g. "from cogan import utils" in the train_.cogan.py can you provide the corresponding code? Thank you and look forward to your reply

vonclites commented 1 week ago

Hello. I think I just have the package organized improperly. It's trying to import this file https://github.com/vonclites/cogan/blob/master/utils.py

Two options to quick fix it are: 1) Create an outer directory, put all the cogan code inside, and put the outer directory on your python path. For example: /path/to/outer_directory/cogan (the cogan directory here is this repository). Then add "/path/to/outer_directory" to your PYTHONPATH. Alternatively, running "python cogan/train_cogan.py" from the outer_directory might achieve the same result, since I think your current working directory becomes automatically added to your python path. 2) Remove "from cogan" from the import lines and hope this doesn't conflict with any existing libraries. For example, change "from cogan import utils" to "import utils", "from cogan.model import Discriminator" to "from model import Discriminator", etc.

The third and correct solution would be to re-arrange the package such that all supporting code sits inside a directory called "cogan" and the train_cogan.py and other training / eval scripts, such as train_loop.py and test_cogan.py sit outside that.

That's my bad. I was improperly using my IDE's ability to set my python path to avoid this issue, instead of organizing the package correctly in the first place.

vonclites commented 1 week ago

Since a lot of the supporting files also use "from cogan import ___" Probably option 1 or 3 would be your best bet.

vonclites commented 1 week ago

Looking through the code again, it looks like I switched to using a third-party library to construct the model. I think you'll need this library too. https://github.com/mkisantal/backboned-unet

Sorry

liang5211314 commented 4 days ago

Thank you very much for your reply, I have solved the above problem. A new problem arose in the process of running the code,

1.according to the readme "run separate_photo_print.py and it will separate either dataset into a bunch of folders for print and photo fingers." At runtime, source_dir = '/home/hulk2/dev/research/cogan_demo/test/cleaned_13' seems to be a local file, but in this network architecture I didn't find the relevant file.
  1. I don't seem to understand what the roc.csv and data.csv in the util_codes are, can you please explain?

Thank you again for your reply, thank you for your guidance and help. Finally, I really hope that you can give me a little suggestion on the direction of my research, I myself want to study iris in vivo detection, but after a period of understanding, I found that there are fewer papers and codes in this field, can you recommend some direction points or related papers and codes? Really, thank you very much! I'm really lost right now and don't know how to move forward, so I hope you can give me a little advice. Thank you and I wish you all the best in your work!