Contribute

Before we can accept contributions, you need to become a CLAed contributor. E-mail a signed copy of the CLAI (and if applicable the CLAC) as PDF file to research@svenkreiss.com.

Modify Code

For development of the openpifpaf source code itself, you need to clone this repository and then:

pip3 install numpy cython
pip3 install --editable '.[dev,train,test]'

The last command installs the Python package in the current directory (signified by the dot) with the optional dependencies needed for training and testing. If you modify functional.pyx, run this last command again which recompiles the static code.

Develop your features in separate feature branches. Create a pull request with your suggested changes. Make sure your code passes pytest, pylint and pycodestyle checks:

pylint openpifpaf
pycodestyle openpifpaf
pytest

cd guide
python download_data.py
pytest --nbval-lax --current-env *.ipynb

Things to Contribute

This is a research project and changing fast. Contributions can be in many areas:

  • Add a new dataset?

  • Add a new base network?

  • Try a different loss?

  • Try a better multi-task strategy?

  • Try a different head architecture?

  • Add a new task?

  • Run on new hardware (mobile phones, embedded devices, …)?

  • Improve training schedule/procedure?

  • Use it to build an app?

  • Improve documentation (!!)

Missing Dependencies

OpenPifPaf has few core requirements so that you can run it efficiently on servers without graphical interface. Sometimes, you just want to install all possible dependencies. Those are provided as “extra” requirements. Use the following pip3 command to install all extras.

import sys
if sys.version_info >= (3, 8):
    import importlib.metadata
    extras = importlib.metadata.metadata('openpifpaf').get_all('Provides-Extra')
    print(f'pip3 install "openpifpaf[{",".join(extras)}]"')

Your Project and OpenPifPaf

Let us know about your open source projects. We would like to feature them in our “related projects” section.

The simplest way to integrate with OpenPifPaf is to write a plugin. If some functionality is not possible through our plugin architecture, open an issue to discuss and if necessary send us a pull request that enables the missing feature you need.

If you do need to make a copy of OpenPifPaf, you must respect our license.

Build Guide

cd guide
jb build .

If you encounter issues with the kernel spec in a notebook, open the notebook with a text editor and find metadata.kernelspec.name and set it to python3.

Alternatively, you can patch your local package yourself. Open venv/lib/python3.9/site-packages/jupyter_cache/executors/utils.py in your editor and add kernel_name='python3' to the arguments of nbexecute() here.

Alternatively, for continuous integration, the kernel_name is replace in the json of the Jupyter Notebook before executing jupyter-book here. Only use this operation on a discardable copy as jq changes all formatting.

Build Environment

%%bash
pip freeze
alabaster==0.7.12
argon2-cffi==20.1.0
astroid==2.5.3
async-generator==1.10
attrs==20.3.0
Babel==2.9.0
backcall==0.2.0
beautifulsoup4==4.9.3
bleach==3.3.0
boto==2.49.0
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
click==7.1.2
colorama==0.4.4
coverage==5.5
cycler==0.10.0
Cython==0.29.22
decorator==5.0.6
defusedxml==0.7.1
docutils==0.16
entrypoints==0.3
flameprof==0.4
future==0.18.2
gitdb==4.0.7
GitPython==3.1.14
idna==2.10
imagesize==1.2.0
importlib-metadata==3.10.0
iniconfig==1.1.1
ipykernel==5.5.3
ipython==7.22.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
isort==5.8.0
jedi==0.18.0
Jinja2==2.11.3
jsonschema==3.2.0
jupyter-book==0.10.2
jupyter-cache==0.4.2
jupyter-client==6.1.12
jupyter-core==4.7.1
jupyter-sphinx==0.3.1
jupyterbook-latex==0.2.0
jupyterlab-widgets==1.0.0
jupytext==1.10.3
kiwisolver==1.3.1
latexcodec==2.0.1
lazy-object-proxy==1.6.0
linkify-it-py==1.0.1
markdown-it-py==0.6.2
MarkupSafe==1.1.1
matplotlib==3.4.1
mccabe==0.6.1
mdit-py-plugins==0.2.6
mistune==0.8.4
myst-nb==0.12.0
myst-parser==0.13.6
nbclient==0.5.3
nbconvert==5.6.1
nbdime==2.1.0
nbformat==5.1.3
nbstripout==0.3.9
nbval==0.9.6
nest-asyncio==1.5.1
nested-lookup==0.2.22
notebook==6.3.0
numpy==1.20.2
onnx==1.8.1
onnx-simplifier==0.3.4
onnxoptimizer==0.2.5
onnxruntime==1.7.0
opencv-python==4.5.1.48
openpifpaf @ file:///home/runner/work/openpifpaf/openpifpaf
packaging==20.9
pandocfilters==1.4.3
parso==0.8.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.2.0
pluggy==0.13.1
prometheus-client==0.10.1
prompt-toolkit==3.0.18
protobuf==3.15.8
ptyprocess==0.7.0
py==1.10.0
pybtex==0.24.0
pybtex-docutils==1.0.0
pycodestyle==2.7.0
pycparser==2.20
pydata-sphinx-theme==0.4.3
Pygments==2.8.1
pylint==2.7.4
pyparsing==2.4.7
pyrsistent==0.17.3
pysparkling==0.6.1
pytest==6.2.3
python-dateutil==2.8.1
python-json-logger==2.0.1
pytz==2021.1
PyYAML==5.4.1
pyzmq==22.0.3
requests==2.25.1
scipy==1.6.2
Send2Trash==1.5.0
six==1.15.0
smmap==4.0.0
snowballstemmer==2.1.0
soupsieve==2.2.1
Sphinx==3.5.4
sphinx-book-theme @ https://github.com/svenkreiss/sphinx-book-theme/archive/onthispage.zip
sphinx-comments==0.0.3
sphinx-copybutton==0.3.1
sphinx-panels==0.5.2
sphinx-thebe==0.0.8
sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.1.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
SQLAlchemy==1.3.24
terminado==0.9.4
testpath==0.4.4
thop==0.0.31.post2005241907
toml==0.10.2
torch==1.7.1+cpu
torchvision==0.8.2+cpu
tornado==6.1
traitlets==5.0.5
typed-ast==1.4.2
typing-extensions==3.7.4.3
uc-micro-py==1.0.1
urllib3==1.26.4
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1
wrapt==1.12.1
zipp==3.4.1
%%bash
python -m openpifpaf.predict --version
OpenPifPaf 0.12.7+1.g0d67fa9