Skip to content

Commit

Permalink
fix(api): catch facebox error before normalizing data
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Oct 7, 2021
1 parent 70a4ce3 commit 67c93c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/src/util/detectors/facebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports.remove = ({ name }) => {
};

module.exports.normalize = ({ camera, data }) => {
if (!data.success) throw new Error(data.error);
const { MATCH, UNKNOWN } = config.detect(camera);
const normalized = data.faces.map((obj) => {
const confidence = parseFloat((obj.confidence * 100).toFixed(2));
Expand Down

0 comments on commit 67c93c4

Please sign in to comment.