From f25619b7e3f7f6618b5e3fecc57cb08fdb67c2a9 Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Tue, 29 Nov 2022 13:31:35 +0100 Subject: [PATCH] nsfw_detect: Tolerate score computation failure --- nsfw_detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsfw_detect.py b/nsfw_detect.py index 6bd9219..225d8a7 100755 --- a/nsfw_detect.py +++ b/nsfw_detect.py @@ -77,11 +77,11 @@ class NSFWDetector: "-cpng", "-i", fpath ], stdout=PIPE, stderr=DEVNULL, check=True) image_data = ff.stdout + + scores = self._compute(image_data) except: return -1.0 - scores = self._compute(image_data) - return scores[1]