Skip to content

Visual Explanations#

Build Visual Inspection
Backend Coverage Status
Frontend Coverage Status

Components#

Environment Variables#

Variable Description Default Value
SERVICE_NAME The name that the app uses as its identifier, e.g. when logging or emitting traces "inspection-service"
ROOT_PATH FastAPI root path (doc) ""
PATH_PREFIX FastAPI router prefix (doc) ""
DEFAULT_EXPLAINER The explanation generator to use if a request does not speficy one "lime"
LOG_INPUT Save input images to disk False
LOG_PATH Path to store the logged images ./log

Running the service locally (with Docker)#

To launch a standalone instance of the service:

cd visual-inspection
docker-compose up

Running the service locally (without Docker)#

During development, it can be desirable to launch the service directly and not as a Docker container. For instance, this allows to get rapid feedback on changes to the backend code.

cd visual-inspection
./build_frontend.sh
cd inspection-backend
uvicorn inspection.main:app

Log input images#

For development purposes, the service can be configured to write the raw input images to disk. This setting is controlled through the environment variable LOG_INPUT:

export LOG_INPUT=1

By default, the images are collected in a sub-folder ./log. To change where the images are saved to, set the environment variable LOG_PATH, e.g.:

export LOG_PATH=/home/myusername/log