Concrete Crack Detection
Steps to Containerize the code on Docker:
-
Assuming that you have Docker installed
-
Create a local folder with all your files along with the Dockerfile, just like I have in this link Run the command after navigating to the working folder to create a docker image which copies all the contents from demo (inference.py, tfrecords, images, tf/fine_tuned_model) to a new folder 'model' (just in the image)
docker build -t newimage
This command builds a new docker image called 'newimage' of all the files in the folder. Our files are saved to the directory 'model' in this image. This building process will take some time because it has to do necessary installations.
-
Open terminal in this folder and run
docker run -ti newimage /bin/bash
-
After this command is executed create a directory with the name 'output' (same name as in inference.py file) using
mkdir output
. Navigate to the model directory and execute the inference.py usingpython3 Inference.py
-
After running the inference.py output images are generated and they are stored in the output folder that is created previously. The output images should be copied to the host from the container, open a new terminal and use the below command with paths file paths accordingly,
docker cp {container_id}:output {path_in_host}
Example:
docker cp c78563b67gj8:output my_files/
The images can be seen in the output folder in the
{my_files}
directory in the host machine.