mirror of
https://git.0x0.st/mia/0x0.git
synced 2026-01-09 20:11:46 +03:00
nsfw_detect: Tolerate score computation failure
This commit is contained in:
@@ -77,11 +77,11 @@ 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
|
||||||
|
|
||||||
|
scores = self._compute(image_data)
|
||||||
except:
|
except:
|
||||||
return -1.0
|
return -1.0
|
||||||
|
|
||||||
scores = self._compute(image_data)
|
|
||||||
|
|
||||||
return scores[1]
|
return scores[1]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user