Skip to content

Commit

Permalink
Implement and document "Pip", "Poetry" and "Docker" based installation.
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mansencal <[email protected]>
  • Loading branch information
KelSolaar committed Aug 19, 2020
1 parent ec12785 commit f525afd
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/.ipynb_checkpoints
poetry.lock
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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'
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
63 changes: 63 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f525afd

Please sign in to comment.