Repository for GFZ section 4.7's contribution to the Long Night of Sciences LNDW 2023: a live photo booth with a fancy "landscape evolution" filter.
https://www.langenachtderwissenschaften.de/
-
booth1.ipynb
: theRecord
button triggers continuous update of a vertical uplift field computed from the webcam stream (with face detection). When the same button is clicked again, it freezes the uplift field then resets it to zero (relaxation) after a few time steps. -
booth2.ipynb
: theTake picture
button only takes a single frame from the webcam and convert it into an uplift field (with face detection). That field is applied for a few time steps before being reset to zero (relaxation).
- clone the git repository:
git clone https://github/fastscape-lem/landscape-booth
- cd into the cloned repository:
cd landscape-booth
- Create a new conda envrionment using
conda
ormamba
:
mamba create --file environment.yml
- Activate the environment:
conda activate landscape-booth
You can run one of the booths as a standalone web app using voila
. Run the following command from the repository root directory (don't forget to first activate the conda environment if not already activated):
voila booth1.ipynb
This should automatically open a new tab in your web browser.
Alternatively (for development) you can run jupyter lab:
jupyter lab
When clicking the Record
(booth 1) or Take picture
(booth 2) button for the first time, your browser should ask your permission to access the webcam.
Click on the Snapshot to file
button to take a snapshot picture and save it to a file. A filename must be given in the text input next to the button. The file is saved in the snapshots
sub-folder in the repository's root directory.
The face detection algorithm works best under the following settings:
- a white and uniform background
- good lighting
- only one person facing the webcam
- the person's face centered in front of the webcam
Despite we did our best to make it stable, it is possible that the booth crashes, freezes or does nothing while running. It is also possible that the system load is too high (CPUs, fans, memory). If that's the case, try the following (in order):
- Press again on the
(Stop) Record
(booth 1) orTake picture
(booth 2) button on the top right (sometimes the face detection algorithm fails) Stop / Reset
andStart
again the simulation- Restart the Kernel and re-run the notebook (when in JupyterLab)
- Refresh the web-browser tab (Voila or JupyterLab)