predict module
- class predict.Classifier(model_path, img_paths)
Bases:
object
Classifier Class used to evaluate lung-xray images into either covid or normal
- Classify(img)
Generates a prediction for the submitted image
- Parameters
img (str) – Path to the image to be classified
- ImageToArray(file)
Converts input image into a numpy array
- Parameters
file (str) – path to the image to be converted to numpy array
- Returns
numpy array of the image
- Return type
img_arr (numpy arr)
- predict.predict(input)
This is the main function that drives the generation of the prediction
- Parameters
input (list) – list of paths to the image to be evaluated by the model. Currently the list is only of one element but can be further expanded to evaluate multiple images
- Returns
‘prediction’ attribute of the Classifier Instance, which is the model prediction of either ‘Normal’ or ‘Covid’
- Return type
str