Computer Vision News - July 2022

50 Medical Imaging AI tool Now that we are positive that the installation worked, we can get familiar with the basics of Docker. Docker allows users to package an application with all its dependencies into a standardized unit. Seems like a dream, right? A background service (called Docker Daemon) is running on the host tobuild, run anddistribute Containers. These are a packaged ensemble of code and dependencies that “activate” when a Docker Image - a saved blueprint of an application - is run on the Docker Engine. Inside a container, the application, which was previously uploaded through an image, can be safely run. Images can be pushed and pulled locally, in a way that Git users are probably already very familiar with. Finally, the Docker Client is the command line tool that allows the user to interact with the Daemon. Now let’s try to use it! We are going to package an application made of a python script, a test folder containing .png images, and a .h5 file. The goal is to use a pretrained classification model to predict the type of retinal disease in fundus images. The inference model we are looking to share with other uses is written in Tensorflow keras and looks like this: from keras.preprocessing import image from tensorflow import keras from PIL import Image import numpy as np import matplotlib.pyplot as plt import os #Function to pre-process new images def data _ resizing _ process (dirs,img _ width,img _ height): datas = keras.utils.load _ img(dirs, target _ size = (img _ width, img _ height)) res = keras.utils.img _ to _ array(datas) res = np.expand _ dims(res, axis = 0 ) res /= 255 return res #Inference function def infer (): img _ width= 300 img _ height= 450

RkJQdWJsaXNoZXIy NTc3NzU=