Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -176,8 +176,9 @@ if picture:
|
|
| 176 |
# Check if there are face landmarks detected
|
| 177 |
gray = cv2.cvtColor(frm, cv2.COLOR_BGR2GRAY)
|
| 178 |
average_brightness = cv2.mean(gray)[0]
|
| 179 |
-
if average_brightness <
|
| 180 |
st.text("إضاءة غير جيدة")
|
|
|
|
| 181 |
st.text("انتقل الى مكان جيد الإضاءة")
|
| 182 |
else:
|
| 183 |
|
|
@@ -220,7 +221,7 @@ if picture:
|
|
| 220 |
X_test_array_reshaped = np.expand_dims(X_array, axis=-1)
|
| 221 |
prediction = model.predict(X_test_array_reshaped)
|
| 222 |
# prediction2 = model2.predict(X_test_array_reshaped)
|
| 223 |
-
if prediction >= 0.
|
| 224 |
st.text("صورة حقيقية")
|
| 225 |
st.text(str(prediction[0]))
|
| 226 |
# st.text(str(prediction2[0]))
|
|
|
|
| 176 |
# Check if there are face landmarks detected
|
| 177 |
gray = cv2.cvtColor(frm, cv2.COLOR_BGR2GRAY)
|
| 178 |
average_brightness = cv2.mean(gray)[0]
|
| 179 |
+
if average_brightness < 100:
|
| 180 |
st.text("إضاءة غير جيدة")
|
| 181 |
+
st.text(str[average_brightness])
|
| 182 |
st.text("انتقل الى مكان جيد الإضاءة")
|
| 183 |
else:
|
| 184 |
|
|
|
|
| 221 |
X_test_array_reshaped = np.expand_dims(X_array, axis=-1)
|
| 222 |
prediction = model.predict(X_test_array_reshaped)
|
| 223 |
# prediction2 = model2.predict(X_test_array_reshaped)
|
| 224 |
+
if prediction >= 0.93:
|
| 225 |
st.text("صورة حقيقية")
|
| 226 |
st.text(str(prediction[0]))
|
| 227 |
# st.text(str(prediction2[0]))
|