summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMia Herkt <mia@0x0.st>2022-11-29 13:31:35 +0100
committerMia Herkt <mia@0x0.st>2022-11-29 13:31:35 +0100
commitf25619b7e3f7f6618b5e3fecc57cb08fdb67c2a9 (patch)
tree66f4d85c8ac4a8e1ab8c98a4cffa189d071db1f4
parentaf4b3b06c0d75a01c1fa59f1f6a4bae12e69daa5 (diff)
nsfw_detect: Tolerate score computation failure
-rwxr-xr-xnsfw_detect.py4
1 files 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]