@@ -97,31 +97,31 @@ def main():
97
97
if image_file is not None :
98
98
our_image = Image .open (image_file )
99
99
st .text ("Original Image" )
100
- st .image (our_image )
100
+ st .image (our_image , width = 500 )
101
101
102
102
enhance_type = st .sidebar .radio (
103
103
"Enhance Type" , ["Original" , "Gray-Scale" , "Contrast" , "Brightness" , "Blurring" ])
104
104
if enhance_type == "Gray-Scale" :
105
105
new_img = np .array (our_image .convert ('RGB' ))
106
106
img = cv2 .cvtColor (new_img , 1 )
107
107
gray = cv2 .cvtColor (img , cv2 .COLOR_BGR2GRAY )
108
- st .image (gray )
108
+ st .image (gray , width = 500 )
109
109
if enhance_type == "Contrast" :
110
110
c_rate = st .sidebar .slider ("Contrast" , 0.5 , 3.5 )
111
111
enhancer = ImageEnhance .Contrast (our_image )
112
112
img_output = enhancer .enhance (c_rate )
113
- st .image (img_output )
113
+ st .image (img_output , width = 500 )
114
114
if enhance_type == "Brightness" :
115
115
c_rate = st .sidebar .slider ("Brightness" , 0.5 , 3.5 )
116
116
enhancer = ImageEnhance .Brightness (our_image )
117
117
img_output = enhancer .enhance (c_rate )
118
- st .image (img_output )
118
+ st .image (img_output , width = 500 )
119
119
if enhance_type == "Blurring" :
120
120
new_img = np .array (our_image .convert ('RGB' ))
121
121
blur_rate = st .sidebar .slider ("Blur" , 0.5 , 3.5 )
122
122
img = cv2 .cvtColor (new_img , 1 )
123
123
blur_img = cv2 .GaussianBlur (img , (11 , 11 ), blur_rate )
124
- st .image (blur_img )
124
+ st .image (blur_img , width = 500 )
125
125
126
126
# Face Detection
127
127
task = ["Faces" , "Smiles" , "Eyes" , "Cannize" , "Cartonize" ]
@@ -130,24 +130,24 @@ def main():
130
130
131
131
if feature_choice == 'Faces' :
132
132
result_img , result_faces = detect_faces (our_image )
133
- st .image (result_img )
133
+ st .image (result_img , width = 500 )
134
134
st .success ("Found {} faces" .format (len (result_faces )))
135
135
136
136
elif feature_choice == 'Eyes' :
137
137
result_img = detect_eyes (our_image )
138
- st .image (result_img )
138
+ st .image (result_img , width = 500 )
139
139
140
140
elif feature_choice == 'Smiles' :
141
141
result_img = detect_smiles (our_image )
142
- st .image (result_img )
142
+ st .image (result_img , width = 500 )
143
143
144
144
elif feature_choice == 'Cannize' :
145
145
result_img = cannize_image (our_image )
146
- st .image (result_img )
146
+ st .image (result_img , width = 500 )
147
147
148
148
elif feature_choice == 'Cartonize' :
149
149
result_img = cartonize_image (our_image )
150
- st .image (result_img )
150
+ st .image (result_img , width = 500 )
151
151
152
152
elif choice == 'About' :
153
153
st .subheader ("About" )
0 commit comments