selfit-camera commited on
Commit
eec2b47
·
1 Parent(s): 83c337a
Files changed (4) hide show
  1. __lib__/app.pyc +1 -1
  2. __lib__/i18n/en.pyc +1 -1
  3. __lib__/util.pyc +2 -2
  4. nfsw_filter.py +10 -0
__lib__/app.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c59e463826e2da194988eaf842416a1f84fd8f9c0504584f47ad0aedda3104f5
3
  size 116861
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:492f08b6358ca855bfccfbec5c974b6867ce6647fbd2186acb15520a017174f5
3
  size 116861
__lib__/i18n/en.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9ab9b5c8a693337039870e7110c9acefdb651931067aa6bce05f80c6760bf598
3
  size 10609
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:869196ee815722c15de51f9a86ad3e20a92ff3f8cb02bceb7d9851186684bd3f
3
  size 10609
__lib__/util.pyc CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2f7b6e25141df41df6a8a2f1d041e5092d67f5ea39764c7d28a502b189c6973b
3
- size 39801
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5434fd34ed8bc4cd11199780193735ee6c89a4da64a61e6157984a56fa95341e
3
+ size 40121
nfsw_filter.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import os
2
  from PIL import Image
3
  import numpy as np
@@ -255,6 +257,14 @@ if __name__ == "__main__":
255
  predicted_label = detector.predict_label_only(single_image_path)
256
  print(f"Image file: {single_image_path}")
257
  print(f"Prediction: {predicted_label}")
 
 
 
 
 
 
 
 
258
  else:
259
  print(f"Error: Image file does not exist: {single_image_path}")
260
 
 
1
+ # Strict mode: When predicted as NSFW, apply image blurring.
2
+
3
  import os
4
  from PIL import Image
5
  import numpy as np
 
257
  predicted_label = detector.predict_label_only(single_image_path)
258
  print(f"Image file: {single_image_path}")
259
  print(f"Prediction: {predicted_label}")
260
+
261
+ # Strict NSFW check
262
+ if predicted_label.lower() == "nsfw":
263
+ print("❌ NSFW content detected, image will be blurred!")
264
+ # TODO: Add image blur logic here
265
+ else:
266
+ print("✅ Image content is normal, allowed to use")
267
+
268
  else:
269
  print(f"Error: Image file does not exist: {single_image_path}")
270