ajeetkumar01 commited on
Commit
2c364fa
·
verified ·
1 Parent(s): 23c5ece

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -44
app.py CHANGED
@@ -3,47 +3,6 @@ from PIL import Image
3
  import numpy as np
4
  from tensorflow.keras.models import load_model
5
 
6
- # Custom CSS for styling
7
- custom_css = """
8
- <style>
9
- body {
10
- background-color: #f0f2f6;
11
- }
12
- .stButton>button {
13
- background-color: #4CAF50;
14
- color: white;
15
- padding: 10px 15px;
16
- text-align: center;
17
- text-decoration: none;
18
- display: inline-block;
19
- font-size: 16px;
20
- margin: 4px 2px;
21
- cursor: pointer;
22
- border-radius: 8px;
23
- border: none;
24
- }
25
- .stButton>button:hover {
26
- background-color: #45a049;
27
- }
28
- .stTextInput>div>div>input {
29
- border-radius: 8px;
30
- }
31
- .stTextInput>div>div>input:focus {
32
- border-color: #4CAF50;
33
- box-shadow: none;
34
- }
35
- </style>
36
- """
37
-
38
- st.markdown(custom_css, unsafe_allow_html=True)
39
-
40
- # Set page configuration
41
- st.set_page_config(
42
- page_title="Face Mask Detection App",
43
- page_icon=":mask:",
44
- layout="wide"
45
- )
46
-
47
  # Define a function to make predictions on a single image
48
  def predict_single_image(image, model):
49
  try:
@@ -81,9 +40,38 @@ def main():
81
  st.title("Face Mask Detection App")
82
  st.write("Upload an image and click 'Predict' to see the prediction.")
83
 
84
- # Header Image
85
- header_image = Image.open("header_image.jpg")
86
- st.image(header_image, use_column_width=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  uploaded_file = st.file_uploader("", type=["jpg", "png", "jpeg"])
89
 
 
3
  import numpy as np
4
  from tensorflow.keras.models import load_model
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  # Define a function to make predictions on a single image
7
  def predict_single_image(image, model):
8
  try:
 
40
  st.title("Face Mask Detection App")
41
  st.write("Upload an image and click 'Predict' to see the prediction.")
42
 
43
+ # Custom CSS for styling
44
+ custom_css = """
45
+ <style>
46
+ body {
47
+ background-color: #f0f2f6;
48
+ }
49
+ .stButton>button {
50
+ background-color: #4CAF50;
51
+ color: white;
52
+ padding: 10px 15px;
53
+ text-align: center;
54
+ text-decoration: none;
55
+ display: inline-block;
56
+ font-size: 16px;
57
+ margin: 4px 2px;
58
+ cursor: pointer;
59
+ border-radius: 8px;
60
+ border: none;
61
+ }
62
+ .stButton>button:hover {
63
+ background-color: #45a049;
64
+ }
65
+ .stTextInput>div>div>input {
66
+ border-radius: 8px;
67
+ }
68
+ .stTextInput>div>div>input:focus {
69
+ border-color: #4CAF50;
70
+ box-shadow: none;
71
+ }
72
+ </style>
73
+ """
74
+ st.markdown(custom_css, unsafe_allow_html=True)
75
 
76
  uploaded_file = st.file_uploader("", type=["jpg", "png", "jpeg"])
77