Advertisement
Guest User

Untitled

a guest
Apr 10th, 2021
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1.  
  2.  
  3. import os
  4. from nudenet import NudeDetector
  5.  
  6.  
  7. detector = NudeDetector()
  8.  
  9.  
  10.  
  11.  
  12.  
  13. directory = 'image path in'
  14. directory_out = 'image path out'
  15.  
  16. #for now it only works with a path that doesn't contain subfolders
  17.  
  18. loop= [os.path.join(directory, file) for file in os.listdir(directory)]
  19. loop_out= [os.path.join(directory_out, file) for file in os.listdir(directory)]
  20.  
  21. ptb=['EXPOSED_ANUS','EXPOSED_BUTTOCKS','EXPOSED_BREAST_F','EXPOSED_GENITALIA_F','COVERED_BREAST_F']
  22.  
  23.  
  24. for i in range(0,len(loop)): detector.censor(
  25.     loop[i],
  26.     out_path=loop_out[i],
  27.     visualize=False,
  28.     parts_to_blur=ptb,
  29.     typec='pix',
  30.     pixs=[8,8]
  31.  
  32. )
  33.  
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement