更新API
This commit is contained in:
1 parent
16769a8726
commit
ece1e8065c
16 files changed
+161
-1
No files matched your search
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const safeContent = [ 'Drawing', 'Neutral' ];
|
||||
|
||||
const contentBoundary = predictions => {
|
||||
let safeProbability = 0;
|
||||
for (let index = 0; index < predictions.length; index++) {
|
||||
const item = predictions[index];
|
||||
const className = item.className;
|
||||
const probability = item.probability;
|
||||
if (safeContent.includes(className)) {
|
||||
safeProbability += probability;
|
||||
}
|
||||
}
|
||||
return safeProbability > 0.5;
|
||||
};
|
||||
|
||||
module.exports = contentBoundary;
|
||||
Reference in new issue
Block a user