mirror of
https://git.0x0.st/mia/0x0.git
synced 2024-11-09 11:48:59 -05:00
nsfw_detect: Tolerate score computation failure
This commit is contained in:
parent
af4b3b06c0
commit
f25619b7e3
1 changed files with 2 additions and 2 deletions
|
@ -77,10 +77,10 @@ class NSFWDetector:
|
||||||
"-cpng", "-i", fpath
|
"-cpng", "-i", fpath
|
||||||
], stdout=PIPE, stderr=DEVNULL, check=True)
|
], stdout=PIPE, stderr=DEVNULL, check=True)
|
||||||
image_data = ff.stdout
|
image_data = ff.stdout
|
||||||
except:
|
|
||||||
return -1.0
|
|
||||||
|
|
||||||
scores = self._compute(image_data)
|
scores = self._compute(image_data)
|
||||||
|
except:
|
||||||
|
return -1.0
|
||||||
|
|
||||||
return scores[1]
|
return scores[1]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue