Skip to content

Commit 99a276e

Browse files
committed
Changes
1 parent eaaf90a commit 99a276e

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

Face_Detection.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,31 +97,31 @@ def main():
9797
if image_file is not None:
9898
our_image = Image.open(image_file)
9999
st.text("Original Image")
100-
st.image(our_image)
100+
st.image(our_image, width=500)
101101

102102
enhance_type = st.sidebar.radio(
103103
"Enhance Type", ["Original", "Gray-Scale", "Contrast", "Brightness", "Blurring"])
104104
if enhance_type == "Gray-Scale":
105105
new_img = np.array(our_image.convert('RGB'))
106106
img = cv2.cvtColor(new_img, 1)
107107
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
108-
st.image(gray)
108+
st.image(gray, width=500)
109109
if enhance_type == "Contrast":
110110
c_rate = st.sidebar.slider("Contrast", 0.5, 3.5)
111111
enhancer = ImageEnhance.Contrast(our_image)
112112
img_output = enhancer.enhance(c_rate)
113-
st.image(img_output)
113+
st.image(img_output, width=500)
114114
if enhance_type == "Brightness":
115115
c_rate = st.sidebar.slider("Brightness", 0.5, 3.5)
116116
enhancer = ImageEnhance.Brightness(our_image)
117117
img_output = enhancer.enhance(c_rate)
118-
st.image(img_output)
118+
st.image(img_output, width=500)
119119
if enhance_type == "Blurring":
120120
new_img = np.array(our_image.convert('RGB'))
121121
blur_rate = st.sidebar.slider("Blur", 0.5, 3.5)
122122
img = cv2.cvtColor(new_img, 1)
123123
blur_img = cv2.GaussianBlur(img, (11, 11), blur_rate)
124-
st.image(blur_img)
124+
st.image(blur_img, width=500)
125125

126126
# Face Detection
127127
task = ["Faces", "Smiles", "Eyes", "Cannize", "Cartonize"]
@@ -130,24 +130,24 @@ def main():
130130

131131
if feature_choice == 'Faces':
132132
result_img, result_faces = detect_faces(our_image)
133-
st.image(result_img)
133+
st.image(result_img, width=500)
134134
st.success("Found {} faces".format(len(result_faces)))
135135

136136
elif feature_choice == 'Eyes':
137137
result_img = detect_eyes(our_image)
138-
st.image(result_img)
138+
st.image(result_img, width=500)
139139

140140
elif feature_choice == 'Smiles':
141141
result_img = detect_smiles(our_image)
142-
st.image(result_img)
142+
st.image(result_img, width=500)
143143

144144
elif feature_choice == 'Cannize':
145145
result_img = cannize_image(our_image)
146-
st.image(result_img)
146+
st.image(result_img, width=500)
147147

148148
elif feature_choice == 'Cartonize':
149149
result_img = cartonize_image(our_image)
150-
st.image(result_img)
150+
st.image(result_img, width=500)
151151

152152
elif choice == 'About':
153153
st.subheader("About")

requirements.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
streamlit
2-
opencv-python-headless
3-
pillow
41
numpy
5-
opencv-contrib-python
2+
streamlit
3+
opencv-python-headless

0 commit comments

Comments
 (0)