A chrome bug means chromium is better to use for now.
This project downloads images, and then creates an audio-reactive slideshow from them.
This project also performs face detection which is persisted to a local database.
This YouTube Video
- The
downloadsDirectoryproperty inconfig/development.json.
npm i
npm run migrate-db-dev
npm run seed-db-dev
npm startnpm run download-imagesYou should now have images in your downloadsDirectory folder (which is specified in the config file).
For orphan images (image files which exist, but do not have a corresponding DB record), this script will add the relevant DB records (step 2)
npm run add-images-file-names-to-dbnpm start
# open in browser
http://localhost:3000/perform-face-detection
You can add music to your copy of this repo to see face changes according to beats in the music.
- Audio should live in
src/client/audio - Update the
on-audio-step.jsfile to reference your newly added audio tracks
A bug in the image downloader scripts means some images are downloaded with query strings, e.g. a7_89698--10845893576_786_789_n.jpg?some-query-string. Running this terminal command will fix that:
ls | sed 's/\(.*\)\(?.*\)/mv \"&\" \"\1\"/' | bashfs.readdirSync('.').filter(file => file.includes('.png')).map(file => {
const nameWithoutExtension = file.split('.')[0]
return {
originalName: `${process.cwd()}/${file}`,
newName: `${process.cwd()}/ffhq-${nameWithoutExtension}--${nameWithoutExtension}.png`
}
}).map(({originalName, newName}) => fs.renameSync(originalName, newName));
