diff --git a/.gitignore b/.gitignore index e902b72..5f91c9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ **/.ipynb_checkpoints +poetry.lock diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5342e7e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Copyright © 2020, Weta Digital, Ltd. +# SPDX-License-Identifier: Apache-2.0 +FROM python:3.7 + +WORKDIR /tmp +COPY ./requirements.txt /tmp +RUN pip install -r requirements.txt \ + && rm /tmp/requirements.txt \ + && python -c "import imageio;imageio.plugins.freeimage.download()" + +RUN mkdir -p /home/weta-digital/physlight +WORKDIR /home/weta-digital/physlight + +CMD sh -c 'cd /home/weta-digital/physlight && jupyter notebook --allow-root --ip=0.0.0.0 --port=8888' diff --git a/README.md b/README.md index 9fa0a21..c1be943 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,61 @@ The `data` directory contains the spectral sensitivity curves of a number of cam The [physlight camera model notebook](https://github.com/wetadigital/physlight/blob/master/physlight_camera_model.ipynb) shows how to use the curves to convert from spectral radiance to Camera RGB, solve matrices to go from Camera RGB to XYZ, and compares different approaches for handling white balance. ![chart image](img/chart_wb.png) + +# Installation + +Three installation methods are available to run the two notebooks. The first +method requires [Python 3](https://www.python.org/downloads/), the second and +third methods requires [Poetry](https://python-poetry.org/) and +[Docker](https://www.docker.com/) respectively. + +## Virtual Environment + +With a [Virtual Environment](https://docs.python.org/3/tutorial/venv.html) +created and activated: + +```bash +$ pip3 install -r requirements.txt +``` + +## Docker + +Creating the container with the [Dockerfile](https://docs.docker.com/engine/reference/builder/) +is done as follows: + +```bash +$ docker build -t wetadigital/physlight:latest "." +``` + +## Poetry + +[Poetry](https://python-poetry.org/) can also be used to install the main +dependencies: + +```bash +$ poetry install +$ poetry run python -c "import imageio;imageio.plugins.freeimage.download()" +``` + +# Usage + +The following sections describes the commands to run to launch the Jupyter +Notebook server according to your installation method. + +## Virtual Environment + +```bash +$ jupyter notebook +``` + +## Docker + +```bash +$ docker run -v $PWD:/home/weta-digital/physlight -p 8888:8888 wetadigital/physlight:latest +``` + +## Poetry + +```bash +$ poetry run jupyter notebook +``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e76093c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +# Copyright © 2020, Weta Digital, Ltd. +# SPDX-License-Identifier: Apache-2.0 +[tool.poetry] +name = "physlight" +version = "1.0.0" +description = "Weta Digital's PhysLight system as presented in the Siggraph 2020 Talk PhysLight: An End-to-End Pipeline for Scene-Referred Lighting." +license = "Apache-2.0" +authors = [ "Weta Digital" ] +maintainers = [ "Weta Digital" ] +readme = 'README.md' +repository = "https://github.com/wetadigital/physlight" +homepage = "https://www.wetafx.co.nz/" + +[tool.poetry.dependencies] +python = "^3.5" +colour-science = { version = "0.3.15" } +jupyter = { version = "*"} +matplotlib = { version = "*"} +requests = { version = "*"} + +[build-system] +requires = [ "poetry>=0.12" ] +build-backend = "poetry.masonry.api" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..876048a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,63 @@ +appnope==0.1.0 +argon2-cffi==20.1.0 +attrs==19.3.0 +backcall==0.2.0 +bleach==3.1.5 +certifi==2020.6.20 +cffi==1.14.2 +chardet==3.0.4 +colour-science==0.3.15 +cycler==0.10.0 +decorator==4.4.2 +defusedxml==0.6.0 +entrypoints==0.3 +idna==2.10 +imageio==2.9.0 +ipykernel==5.3.4 +ipython==7.9.0 +ipython-genutils==0.2.0 +ipywidgets==7.5.1 +jedi==0.17.2 +Jinja2==2.11.2 +jsonschema==3.2.0 +jupyter==1.0.0 +jupyter-client==6.1.6 +jupyter-console==6.1.0 +jupyter-core==4.6.3 +kiwisolver==1.1.0 +MarkupSafe==1.1.1 +matplotlib==3.0.3 +mistune==0.8.4 +nbconvert==5.6.1 +nbformat==5.0.7 +notebook==6.1.3 +numpy==1.18.5 +packaging==20.4 +pandocfilters==1.4.2 +parso==0.7.1 +pexpect==4.8.0 +pickleshare==0.7.5 +Pillow==7.2.0 +prometheus-client==0.8.0 +prompt-toolkit==2.0.10 +ptyprocess==0.6.0 +pycparser==2.20 +Pygments==2.6.1 +pyparsing==2.4.7 +pyrsistent==0.16.0 +python-dateutil==2.8.1 +pyzmq==19.0.2 +qtconsole==4.7.6 +QtPy==1.9.0 +requests==2.24.0 +scipy==1.4.1 +Send2Trash==1.5.0 +six==1.15.0 +terminado==0.8.3 +testpath==0.4.4 +tornado==6.0.4 +traitlets==4.3.3 +urllib3==1.25.10 +wcwidth==0.2.5 +webencodings==0.5.1 +widgetsnbextension==3.5.1