Spectacular Mood Meter - for V2_'s Evening of the Black Box.
Find a file
2017-12-07 15:11:39 +01:00
cmake_modules Add custom module 2016-03-18 14:31:27 -04:00
common Read subsequently numbered files 2017-11-17 16:17:31 +01:00
opencv-webcam-demo Edits for live 2017-12-07 15:08:12 +01:00
video-demo Fix 3.4 bug (#36) 2017-10-20 17:56:24 -04:00
.gitignore Initial commit 2015-03-09 17:32:50 -04:00
.travis.yml Fix 3.4 bug (#36) 2017-10-20 17:56:24 -04:00
affdex-win-samples.sln Fix 3.4 bug (#36) 2017-10-20 17:56:24 -04:00
appveyor.yml Fix 3.4 bug (#36) 2017-10-20 17:56:24 -04:00
CMakeLists.txt Fix a bug where the screen hangs in the case of photo/video 2016-04-05 13:58:40 -04:00
console.html Fun from cli and host as websocket 2017-11-16 17:11:28 +01:00
graphs.php Merge branch 'master' of rubenvandeven.com:~/git/crowdcamera 2017-12-07 15:11:39 +01:00
images.php Edits for live 2017-12-07 15:08:12 +01:00
ISSUE_TEMPLATE.txt "leverage" -> "use" 2017-07-07 10:05:09 -04:00
LICENSE.txt Add license file to the repository 2016-01-05 11:36:58 -05:00
lodash.core.min.js Version ready for live 2017-12-04 21:47:24 +01:00
parse_output.py Edits for live 2017-12-07 15:08:12 +01:00
plotly-1.31.2.min.js Version ready for live 2017-12-04 21:47:24 +01:00
README.md update pipeline info 2017-12-07 15:08:25 +01:00
requirements.txt Fun from cli and host as websocket 2017-11-16 17:11:28 +01:00
run.py Read subsequently numbered files 2017-11-17 16:17:31 +01:00
split_and_merge_output.py Edits for live 2017-12-07 15:08:12 +01:00

The crowd will tell us

Pipeline

  • Gphoto2 takes pictures (not vm) into a 'pictures/{1,2,3}' dir.
  • These get splitted by split_and_merge_output.py to a 'segments' subdir. (To be able to detect smaller faces)
  • Our modified opencv-webcam-demo will analyse these images and output json
  • The same split_and_merge_output.py process will detect the segment jsons and merge them back into the 'pictures/{1,2,3}' dir. It subsequently deletes the segmented photos

[TODO: remove duplicate faces on merge]

Now we have our dataset of photo's with JSONS.

To output:

  • parse_output.py -o ~/pictures/{1,2,3} --json --window-size 10 > ~/sdk-samples/output/talk1.json Creates a json file suitable for webbrowser graphing
  • python parse_output.py -o ~/pictures/{1,2,3} --wav ~/pictures/{1,2,3}.wav --targetDir /home/crowd/sdk-samples/output/1 --window-size 10 Assumes a WAVE file that starts simultaneously with frame 1. and splits it into the windows
  • Start server for graph.php & image.php cd ~/sdk-samples && php -S 0.0.0.0:8000
  • Navigate to: http://192.168.178.33:8000/graphs.php to view images

Done :-)

Commands

Start a few processes:

gphoto2 to capture images every 2 sec:

gphoto2 --port usb: --capture-image-and-download -I 2 --filename=/home/crowd/output/frame%06n.jpg

SET FPS IN parse_output.py

If using Sony A7s/r, Ubuntu 14.04 has a too old version of gphoto2, so use vm-host with gphoto. Mount pictures dir to vbox:

sudo mount -t vboxsf pictures ~/pictures -o rw,uid=1000,gid=1000

The modified 'webcam demo' to analyse and generate json:

/home/crowd/build/opencv-webcam-demo/opencv-webcam-demo --data /home/crowd/affdex-sdk/data --faceMode 1 --numFaces 80 -o /home/crowd/output/segments/ --draw 0 --segments 1

When using --segments 1 also run:

python split_and_merge_output.py --frameOutput ~/output --segmentDir ~/output/segments/

Using split_and_merge_output, frames are split into segments so SMALL_FACES actually detects really small faces. This requires enabling --segments on opencv-webcam-demo (so it detects/writes segment%06d files) split_and_merge_output also remerges these segment%06.json files into a frame%06d.json file.

When done, generate output:

parse_output.py -o ~/output1 --json --window-size 1 > ~/sdk-samples/output/talk1.json parse_output.py -o ~/output2 --json --window-size 1 > ~/sdk-samples/output/talk2.json parse_output.py -o ~/output3 --json --window-size 1 > ~/sdk-samples/output/talk3.json

and audio, which expects wav to start simmmultaneously with frame00001:

python parse_output.py -o ~/pictures/1 --wav ~/pictures/1.wav --targetDir /home/crowd/sdk-samples/output/1 --window-size 1 python parse_output.py -o ~/pictures/2 --wav ~/pictures/2.wav --targetDir /home/crowd/sdk-samples/output/2 --window-size 1 python parse_output.py -o ~/pictures/3 --wav ~/pictures/3.wav --targetDir /home/crowd/sdk-samples/output/3 --window-size 1

Then start server:

cd ~/sdk-samples && php -S 0.0.0.0:8000

Navigate to: http://192.168.178.33:8000/graphs.php to view images