Visual inspection¶
Software for automatic visual inspection of ATLAS ITk Pixel module pads before wire-bonding.
To deploy your own instance of the app:
-
Pull the Docker image of the app from container registry.
-
Change the configuration of the docker image. For more info see the Section Specifications.
-
Deploy it of your machine.
-
Once launched, go to the address: IP_of_machine:9003/. Online API, documentation with Swagger: IP_of_machine:9003/docs.
Specifications¶
SFTP¶
- This server uses a private SFTP connection to communicate with EOS.
- SFTP connection is configured with environment variables:
SFTP_USER
: EOS username.SFTP_PASSWORD
: EOS password.SFTP_HOST
: EOS host.SFTP_PROJECT_PATH
: EOS root project path (the one containingmodels/
andmodules/
).
- Some files are required to be present in the EOS project directory:
SFTP_PROJECT_PATH/
models/
default.pckl
config.yaml
MongoDB (database)¶
- This server uses a MongoDB database to store the data.
- MongoDB's connection is configured with environment variables:
MONGO_USER
: MongoDB username.MONGO_PASSWORD
: MongoDB password.MONGO_HOST
: MongoDB host.MONGO_DATABASE
: MongoDB database name.
- Module model (stored in
modules
collection):_id
: module unique identifier (generated by MongoDb for each entry)name
: module namedescription
: module descriptionuploaded_by
: user who uploaded the moduleuploaded_at
: date when the module was uploadedlast_updated_at
: date when the module was last updatedright
&left
: Sides of the moduletag
: tag of the side (left or right)tile_count
: number of tiles in the sideverified_masks
: List of boolean values indicating if the mask of the tile has been verifiedoriginal
: Original image informationthumbnail
: Thumbnail version of the imagesrc_id
: Image identifier (not tiled)tiled_id
: List of image identifiers (tiles ids)
full
: width of the original imagesrc_id
: Image identifier (not tiled)tiled_id
: List of image identifiers (tiles ids)
preprocessed
:- ... Same model as
original
, with the preprocessed image data
- ... Same model as
anomaly_map
:- ... Same model as
original
, with the colorized anomaly map (the nice one)
- ... Same model as
mask
:- ... Same model as
original
, with the original mask from ML (no corrections)
- ... Same model as
corrected_mask
:- ... Same model as
original
, with the original mask from ML (with corrections)
- ... Same model as
- GridFS is used to store the images and the masks, so a simple request to the database is not enough to get the
image
data, but hopefully you can use
/api/images/{image_id}
to get the image in your browser.
Cluster¶
NOT REQUIRED TO USE THE APPLICATION
The idea is to have access to a cluster to run the ML model on the images, which can be done locally but will take a significant amount of time.
- The connection is configured with environment variables:
CLUSTER_SWITCH
: True if use cluster, False if run on the machine.CLUSTER_USER
: Cluster username.CLUSTER_PASSWORD
: Cluster password.CLUSTER_HOST
: Cluster host.CLUSTER_ROOTDIR
: Cluster root project path, where the evaluations will occur.GITLAB_USER
: Gitlab username, used to pull the ML image.GITLAB_PASSWORD
: Gitlab password, used to pull the ML image.GITLAB_PASSWORD
: Gitlab password- nb: No native tunnelling is implemented.
Workflow:
- Connection to the Cluster
- Creation of the
CLUSTER_ROOTDIR
directory - Upload of the models necessary for the evaluation (previously downloaded from EOS)
- Connection to the Gitlab where the Docker image of the ML is stored
- Pull of the Docker image
- Upload of the image to evaluate to the Cluster
- Run of the Docker image as a Singularity container
- Wait for the evaluation to finish (repetition of sacct command)
- Download of the results from the Cluster
Front-end (dart Flutter)¶
The entire flutter app is in the lib/
directory.
Back-end (python FastAPI)¶
The application is in the backend/
directory.
Quickstart (localhost)¶
Flutter local installation¶
1 2 3 |
|
Application setup¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Then go to http://localhost:8000.