This is the official repository for MMCBM: Interpretable Diagnosis of Choroid Neoplasias via the Multimodal Concept Bottleneck Model.
-
Create a conda environment from the
environment.yml
file:conda env create -f environment.yml
-
Install from the requirements.txt file:
pip install -r requirements.txt
- download
the model checkpoint place
it.
- backbone: at
work_dir/result/Efficientb0_SCLS_attnscls_CrossEntropy_32
- MMCBM: at
work_dir/result/CAV_m2CBM_sigmoid_C0.1CrossEntropy_32_report_strict_aow_zero_MM_max
- backbone: at
- ChatGPT
fill in the
openai_info
section inparams.py
with your ownapi_key
andapi_base
from OpenAI. - Tencent Translation (Optional)
fill in the
tencent_info
section inparams.py
with your ownapp_id
andapp_key
from Tencent Cloud.
- Web Interface using Gradio (Recommended), our web interface is available at Interface Link.
- you can also run this website locally by running the following command in the terminal:
then open the browser and enter
python web_interface.py
http://127.0.0.1:7860/
to access the website. - you can also build the docker image and run it:
then open the browser and enter
docker build -t mmcbm . docker run --name mmcbm -p 7860:7860 mmcbm
http://127.0.0.1:7890
to access the website.
Command Line without Gradio. We also provide a bash script to run the model inference from the command line:
python mmcmb_inference.py