Added skip on corrupt images

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2020-01-05 10:15:53 -08:00
parent 756272ea6a
commit ca956cc8af
2 changed files with 9 additions and 1 deletions

View File

@ -20,7 +20,7 @@ At this point, port 8123 will be supporting the photo app.
#### Upgrade Node
```bash
wget -qO- https://deb.nodesource.com/setup_8.x | sudo bash -
wget -qO- https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install --yes nodejs
```

View File

@ -147,6 +147,14 @@ faceapi.nets.ssdMobilenetv1.loadFromDisk('./models')
},
});
});
}).catch((error) => {
console.warn("Skipping out on image " + photoPath + " and marking to 0 faces to prevent future scanning.");
return photoDB.sequelize.query("UPDATE photos SET faces=:faces WHERE id=:id", {
replacements: {
id: photo.id,
faces: 0
},
});
}).then(() => {
processed++;
const now = Date.now();