Check routes
flask --app db_service routes
flask --app model_service/resnet50 routes
flask --app xai_service/pytorch_cam routes
Run debug mode
flask --app model_service/resnet50 --debug run -p 5001
flask --app db_service --debug run -p 5002
flask --app xai_service/pytorch_cam --debug run -p 5003
flask --app evaluation_service --debug run -p 5004
This is the frontend for the eXplainable AI service.
The project uses Next.js framework, styled with Tailwindcss, and Prisma ORM.
It is hosted on Vercel.
- Node >=
18.x
- npm >=
8.18.0
- Docker Engine
- Configure your
.env
environment variables from.env.template
- Clone the project:
git clone https://github.com/ZeruiW/XAI-Service
- Change directory into cloned folder:
cd XAI-Service
- Install node depencies:
npm i
- Start development server:
npm run dev
{"method_name":"hirescam","data_set_name":"azure_cog","data_set_group_name":"1500","model_name":"resnet50"}
{"explanation_task_ticket":"CRx1G9HCKKsh4Qs.9OF7NXAJSL"}
Please have the mongo.dev.conf
or mongo.pred.conf
under the backend folder.
conn_str=<<your mongodb url str>>
Please have the az_blob_connection_str.json
under the backend folder:
backend/central/central_storage/tmp/az_blob_connection_str.json
;backend/db_service/azure_blob/azure_blob_storage/tmp/az_blob_connection_str.json
The file is private, if you need them, please contact JUN. Or you can deploy your own Azure Blob Service.
Please use:
flask --app 'backend/central:create_app("dev")' run -p 5006
or
flask --app 'backend/central:create_app("pred")' run -p 5006
to start the flask application.
If you are the first time, please also create a volume for MySQL.
docker volume create xaifw-mysql
Then:
docker compose -f backend/db_service/docker-compos-mysql.yaml up -d
docker volume create xai_fw_volumes
docker compose -f backend/docker-compose.yml -f backend/docker-compose-dev.yml up --build
Or for single service:
docker compose -f backend/docker-compose.yml -f backend/docker-compose-dev.yml up [service_name] --build
-
Azure Blob Service;
-
Densenet121 service:
flask --app backend/model_service/densenet121 run -p 5010
-
multiple cam method support
To start grad-cam:
flask --app 'backend/xai_service/pytorch_cam:create_app(cam_method="grad-cam")' run -p 5003
or just
flask --app backend/xai_service/pytorch_cam run -p 5003
Then the service endpoint is same as before:
http://127.0.0.1:5003/xai/pt_cam
To start other cams, like
grad-camew
:flask --app 'backend/xai_service/pytorch_cam:create_app(cam_method="grad-camew")' run -p 5011
The service endpoint will be:
http://127.0.0.1:5011/xai/pt_cam/grad-camew
Cam method List:
if cam_method == None or cam_method == 'grad-cam': cam = GradCAM(**cam_kws) if cam_method == 'hirescam': cam = HiResCAM(**cam_kws) if cam_method == 'scorecam': cam = ScoreCAM(**cam_kws) if cam_method == 'grad-campp': cam = GradCAMPlusPlus(**cam_kws) if cam_method == 'ablationcam': cam = AblationCAM(**cam_kws) if cam_method == 'xgrad-cam': cam = XGradCAM(**cam_kws) if cam_method == 'eigencam': cam = EigenCAM(**cam_kws) if cam_method == 'eigengrad-cam': cam = EigenGradCAM(**cam_kws) if cam_method == 'layercam': cam = LayerCAM(**cam_kws) if cam_method == 'fullgrad': cam = FullGrad(**cam_kws) if cam_method == 'grad-camew': cam = GradCAMElementWise(**cam_kws)
- Linux x86-64:
- Ubuntu 22.04 LTS (Best)
- Debian 11 "Bullseye" Stable branch
- RHEL 8
- Arch
- macOS x86-64 / ARM64 (local dev only)
- Windows x86-64:
- Windows 10 >= 1909 update
- Windows 11
- NVIDIA CUDA Library
- Vulkan
Tasks and child tasks are priority tagged starting from 0 as the highest priority. E.g. P0
, P1
,...Pn
. Finished tasks are stripped of the priority tag.
For maintainers, it is advised to follow the Notion documentation (shared internally) as the single source of truth.
Progress moved to Github Projects