mirror of
https://github.com/MeowLynxSea/CatismImage.git
synced 2025-07-09 10:54:35 +00:00
完成NSFW阈值
This commit is contained in:
parent
84d9b7f157
commit
66cce8693d
@ -77,7 +77,7 @@ def upload_image():
|
|||||||
nsfw_data = response.json()
|
nsfw_data = response.json()
|
||||||
|
|
||||||
# 检查NSFW评分
|
# 检查NSFW评分
|
||||||
if nsfw_data.get('neutral', 0) + nsfw_data.get('drawing', 0) < 1 - AppConfig.NSFWPY_THRESHOLD:
|
if nsfw_data.get('neutral', 0) + nsfw_data.get('drawing', 0) < 1 - float(AppConfig.NSFW_THRESHOLD):
|
||||||
return jsonify({'error': '图片内容未通过NSFW检查'}), 403
|
return jsonify({'error': '图片内容未通过NSFW检查'}), 403
|
||||||
|
|
||||||
file.seek(0)
|
file.seek(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user