Webapp interface to Evaluate chest x-ray image for pneumonia using Trained CNN model.
2022-11-22.20-47-43.mp4
- Visual studio code
- python 3.10
- flask -
pip install flask
- flask_mysqldb -
pip install flask_mysqldb
- TensorFlow -
pip install tensorflow==2.10
- OpenCV -
pip install opencv-python
- Matplotlib -
pip install matplotlib
-
clone repository.
-
keep the structure of directories same do not change names of 'staticFiles' and 'templates' folder unless you know what you are doing.
-
Download p1.h5 model file and add it to any directory on your pc.
-
Give path to the p1.h5 file in following codeline (main.py)
model = tf.keras.models.load_model('path here')
-
Download and install MySQL, you can Refer to this guide if you dont know what options to choose during installation.
-
Open MySQL Workbench login to localhost and run following command in Query tab.
CREATE DATABASE IF NOT EXISTS `pythonlogin` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `pythonlogin`; CREATE TABLE IF NOT EXISTS `accounts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, `email` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; INSERT INTO `accounts` (`id`, `username`, `password`, `email`) VALUES (1, 'test', 'test', 'test@test.com');
-
Put your MySQl database password in app.config(main.py).
# Enter your database connection details below app.config['MYSQL_HOST'] = 'localhost' app.config['MYSQL_USER'] = 'root' app.config['MYSQL_PASSWORD'] = 'Your password here' app.config['MYSQL_DB'] = 'pythonlogin'
-
Run main.py
https://thinkinfi.com/upload-and-display-image-in-flask-python/
https://flask.palletsprojects.com/en/2.2.x/patterns/fileuploads/