One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
# we make our imports | |
from flask import Flask,render_template,redirect,request,send_from_directory | |
from tensorflow.keras.models import load_model | |
import os | |
from PIL import Image | |
import numpy as np | |
# we load the model before starting the app | |
model_file = "model.h5" | |
model = load_model(model_file) |
# we make our imports | |
from flask import Flask,render_template,redirect,request,send_from_directory | |
from tensorflow.keras.models import load_model | |
import os | |
from PIL import Image | |
import numpy as np | |
# we load the model before starting the app | |
model_file = "model.h5" | |
model = load_model(model_file) |
{% extends 'base.html' %} | |
{% block content%} | |
<center><img src="{{ url_for('static', filename= filename) }}" alt="" style="width: 300px; height:300px;"></center> | |
<br> | |
<br> | |
{% if show==True %} | |
<center> | |
{% if message=="healthy" %} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Pneumonia Detection Project</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
</head> | |
<body> | |
<nav class="navbar navbar-dark bg-dark"> |
# we make our imports | |
from flask import Flask,render_template,redirect,request,send_from_directory | |
from tensorflow.keras.models import load_model | |
import os | |
from PIL import Image | |
import numpy as np | |
# we load the model before starting the app | |
model_file = "model.h5" | |
model = load_model(model_file) |
# making the imports | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from tensorflow.keras.layers import Input,Conv2D,MaxPooling2D,Dropout,Flatten,Dense,Activation,BatchNormalization,add | |
from tensorflow.keras.models import Model,Sequential | |
from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
from tensorflow.keras.utils import plot_model | |
from tensorflow.keras.applications.vgg16 import VGG16,preprocess_input | |
import os |
# Making the imports | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import cv2 | |
import os | |
from imutils import build_montages | |
def plot_distribution(paths:list,portion:str): | |
""" | |
This function is used to plot the distribution of train and test images among NORMAL and PNEUMONIA labels |
import cv2 | |
from tensorflow.keras.models import load_model | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import os | |
from imutils import build_montages | |
haar_cascade = "haarcascade_frontalface_default.xml" | |
imgs = os.listdir(path_to_images_dir) | |
model_name = path_to_model |
import cv2 | |
from tensorflow.keras.models import load_model | |
import numpy as np | |
cascade_file = "haarcascade_frontalface_default.xml" | |
model_file = "fermodel.h5" | |
emotions = ["angry","disgust","scared", "happy", "sad", "surprised","neutral"] | |
face_detection = cv2.CascadeClassifier(cascade_file) | |
emotion_classifier = load_model(model_file, compile=False) |