nsfw_detect: Tolerate score computation failure

This commit is contained in:
Mia Herkt 2022-11-29 13:31:35 +01:00
parent af4b3b06c0
commit f25619b7e3
Signed by: mia
GPG Key ID: 72E154B8622EC191
1 changed files with 2 additions and 2 deletions

View File

@ -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]