├── requirements.txt ├── inference.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | opencv-python 3 | tensorflow 4 | matplotlib -------------------------------------------------------------------------------- /inference.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import numpy as np 3 | import cv2 4 | from tensorflow.keras.models import load_model 5 | 6 | parser = argparse.ArgumentParser() 7 | parser.add_argument("--input_model",type=str,help="Please Enter path of input model/ Example: model.h5") 8 | parser.add_argument("--input_image",type=str,help="Please Enter path of input image/ Example: image.jpg") 9 | arg = parser.parse_args() 10 | model = load_model(arg.input_model) 11 | 12 | image = cv2.imread(arg.input_image) 13 | image = cv2.resize(image,(150,150)) 14 | image = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) 15 | image = image / 255.0 16 | image = image.reshape(1,150,150,3) 17 | 18 | predict = np.argmax(model.predict(image)) 19 | if predict == 0: print("Covid") 20 | elif predict == 1: print("Normal") 21 | elif predict == 2: print("Viral Pneumonia") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CovidDiagnosis-XRay 2 | 3 | **Dataset Link:** [Covid19-XRay](https://www.kaggle.com/pranavraikokte/covid19-image-dataset) 4 | 5 | **Model Link:** [Model](https://drive.google.com/drive/folders/1T2nxj_R8dLHoP_Kz9gQ9YCDAsIcUHjW1?usp=sharing) 6 | 7 | 8 | - Covid19 Diagnosis using X-Ray Dataset 9 | 10 | ![1](https://user-images.githubusercontent.com/88143329/155208311-73576e59-ba6b-466b-96dc-71999673fffc.png) 11 | 12 | - Algorithm: 13 | - [x] Convolutional Neural Network(CNN) 14 | 15 | - Accuracy & Loss: 16 | 17 | Algorithm | Accuracy | Loss | 18 | ------------- | ------------- | ------------- | 19 | Personal model | **100.00 %** | **0.0719** | 20 | 21 | 22 | - Inference: 23 | 24 | ## RUN 25 | You can run Inference with the following command 26 | 27 | **Please Download [Model](https://drive.google.com/drive/folders/1T2nxj_R8dLHoP_Kz9gQ9YCDAsIcUHjW1?usp=sharing)** 28 | 29 | ``` 30 | $ pip install requirements.txt 31 | 32 | python inference.py [--input_model INPUT] [--input_image INPUT] 33 | ``` 34 | --------------------------------------------------------------------------------