mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: handle_sensitive_image
This commit is contained in:
parent
6defbbefc3
commit
6f7ff6eb0d
@ -1,5 +1,6 @@
|
||||
import re
|
||||
|
||||
import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
from module.base.mask import Mask
|
||||
@ -27,17 +28,17 @@ def put_image_mask(image, mask):
|
||||
def handle_sensitive_image(image):
|
||||
"""
|
||||
Args:
|
||||
image (PIL.Image.Image):
|
||||
image:
|
||||
|
||||
Returns:
|
||||
PIL.Image.Image:
|
||||
"""
|
||||
if PLAYER_CHECK.match(image, offset=(30, 30)):
|
||||
image = MASK_PLAYER.apply(image)
|
||||
image = Image.fromarray(MASK_PLAYER.apply(image), mode='RGB')
|
||||
if MAIN_CHECK.match(image, offset=(30, 30)):
|
||||
image = MASK_MAIN.apply(image)
|
||||
image = Image.fromarray(MASK_MAIN.apply(image), mode='RGB')
|
||||
|
||||
return Image.fromarray(image, mode='RGB')
|
||||
return image
|
||||
|
||||
|
||||
def handle_sensitive_text(text):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user