We provide file environment.yml
for dependencies
conda env create -f environment.yml
conda activate AdaTriplet
cd AdaTriplet/
pip install -e .
- Knee X-ray: Download the OAI dataset via https://nda.nih.gov/oai/.
- Chest X-ray: Download the ChestXrays-14 dataset at https://nihcc.app.box.com/v/ChestXray-NIHCC/
- Create the image folder
./ResizedImages_{OAI|CXR}
Run the script as follows:
python train.py data_type=<OAI|CXR> \
image_crop_path=<path-to-ResizedImages> \
image_raw_path=<path-to-folder-of-raw-images> \
metadatapath=<path-to-meta-data> \
datapath=<path-to-dataframe> \
method=<method_name>
Our code supports 8 method_name
s:
AdaTriplet-AM
: AdaTriplet loss with AutoMargin selectionAdaTriplet
Triplet-AM
: Triplet loss with AutoMargin selectionTriplet
SCT
WAT
ArcFace
SoftTriplet
###Test
Run the script as follows:
python test.py data_type=<OAI|CXR>
query_time=<time-in-months|all>
pretrained_matching_model_folder_path=<path-to-folder-of-trained-models>