frogleo commited on
Commit
97ebe37
·
verified ·
1 Parent(s): 4c3eb80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -280,7 +280,9 @@ def _generate_video(
280
  # NSFW 检测
281
  if nsfw_model and nsfw_processor:
282
  num_total_frames = len(output_frames_list)
283
- if detect_frames_nsfw(output_frames_list,num_total_frames // (FIXED_FPS/2),0.6):
 
 
284
  msg = "Generated video contains NSFW content and cannot be displayed. Please modify the input image or prompt and try again."
285
  raise Exception(msg)
286
 
 
280
  # NSFW 检测
281
  if nsfw_model and nsfw_processor:
282
  num_total_frames = len(output_frames_list)
283
+ sample_count = max(1, int(num_total_frames // (FIXED_FPS / 2)))
284
+
285
+ if detect_frames_nsfw(output_frames_list,sample_count,0.6):
286
  msg = "Generated video contains NSFW content and cannot be displayed. Please modify the input image or prompt and try again."
287
  raise Exception(msg)
288