Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ def get_distance(predictions):
|
|
50 |
|
51 |
return detections
|
52 |
|
53 |
-
def distinguish_rows(lst, thresh=
|
54 |
"""Function to help distinguish unique rows"""
|
55 |
sublists = []
|
56 |
for i in range(0, len(lst)-1):
|
@@ -64,7 +64,7 @@ def distinguish_rows(lst, thresh=15):
|
|
64 |
yield sublists
|
65 |
|
66 |
# Title of the app
|
67 |
-
st.title("
|
68 |
|
69 |
# File uploader widget
|
70 |
uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
|
@@ -105,7 +105,9 @@ if uploaded_file is not None:
|
|
105 |
print(predictions[0][0],predictions[0][1])
|
106 |
if predictions[0][0]>predictions[0][1]:
|
107 |
print('safe')
|
108 |
-
st.write('
|
|
|
109 |
else:
|
110 |
print('Not safe')
|
111 |
-
st.write('
|
|
|
|
50 |
|
51 |
return detections
|
52 |
|
53 |
+
def distinguish_rows(lst, thresh=10):
|
54 |
"""Function to help distinguish unique rows"""
|
55 |
sublists = []
|
56 |
for i in range(0, len(lst)-1):
|
|
|
64 |
yield sublists
|
65 |
|
66 |
# Title of the app
|
67 |
+
st.title("NSFW Content Detector")
|
68 |
|
69 |
# File uploader widget
|
70 |
uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
|
|
|
105 |
print(predictions[0][0],predictions[0][1])
|
106 |
if predictions[0][0]>predictions[0][1]:
|
107 |
print('safe')
|
108 |
+
st.write('Safe for Work')
|
109 |
+
st.text_area("The given content has", "SFW")
|
110 |
else:
|
111 |
print('Not safe')
|
112 |
+
st.write('Not Safe for Work')
|
113 |
+
st.text_area("The given content has", "NSFW")
|