Juno360219 commited on
Commit
c6a5210
1 Parent(s): 2794a3c

crested nsfw

Browse files
Files changed (1) hide show
  1. nsfw +9 -0
nsfw ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ def check_safety(x_image):
2
+ # safety_checker_input = safety_feature_extractor(numpy_to_pil(x_image), return_tensors="pt")
3
+ # x_checked_image, has_nsfw_concept = safety_checker(images=x_image, clip_input=safety_checker_input.pixel_values)
4
+ # assert x_checked_image.shape[0] == len(has_nsfw_concept)
5
+ # for i in range(len(has_nsfw_concept)):
6
+ # if has_nsfw_concept[i]:
7
+ # x_checked_image[i] = load_replacement(x_checked_image[i])
8
+ # return x_checked_image, has_nsfw_concept
9
+ return x_image, False