Screening CT 3d images for interpretable COVID19 detection.
The API is accessible at the following endpoints:
/
which gives a welcome message/docs
which provides a documentation of the API/models
which provides a list of available models/predict
used to receive prediction for a given image and his bounding box
The request is made by passing:
- the image to be processed
- the bounding box of the image
An example of request with curl
:
curl -X 'POST' \
'http://localhost:5000/predict?xmin=0&ymin=0&xmax=224&ymax=224' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=filename.png;type=image/png'
Our container is hosted on dockerhub:
docker pull peppocola/ct-covid:v1
It is preferable to run the container with a GPU, but if you don't have one, you can run it with a CPU without problems.
docker run -p 5000:5000 --rm -it --name=ct-covid peppocola/ct-covid:v1
docker run -p 5000:5000 --rm -it --gpus 1 --name=ct-covid peppocola/ct-covid:v1
If you just want to run the api:
pip install -r requirements.txt
If you want to use tools like locust
, pytest
and great_expectations
:
pip install -r requirements_dev.txt
python src/api.py
Those commands will run the api, which will accept requests on port 5000.
cd src/frontend
npm install
npm start
docker run -d -p 9090:9090 --add-host host.docker.internal:host-gateway \
-v "$PWD/prometheus.yml":/etc/prometheus/prometheus.yml \
--name=prometheus prom/prometheus
docker run -d -p 3000:3000 --add-host host.docker.internal:host-gateway \
--name=grafana grafana/grafana-enterprise
locust -f tests/locust.py --host http://localhost:5000
To run pytest without gpu:
PYTHONPATH=src pytest -m "not gpu" --cov src/covidx tests/
To run pytest with gpu:
PYTHONPATH=src pytest --cov src/covidx tests/
cd tests
for checkpoint in ct-train ct-valid ct-test
do
great_expectations --v3-api checkpoint run $checkpoint
done