Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnec committed Aug 24, 2020
0 parents commit a73a9a5
Show file tree
Hide file tree
Showing 74 changed files with 18,360 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .coveragerc to control coverage.py
[run]
branch = True
omit =
*/site-packages/*
*/distutils/*
tests/*
examples/*
depthy/misc/plots.py

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True

[html]
directory = coverage_html_report
151 changes: 151 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit tests / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
coverage_html_report/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# user-defined

# own files and directories
.idea
.DS_Store
other/
WG12_cvpr_paper/
depthy/stereo/
depthy/tests/test_stereo.py
examples/*.png
examples/data/*/
examples/data/*.zip
depthy/lightfield/depth_labeling.py
tests/test_depth_labeling.py
*.ply
*.pfm

# Allow
examples/data/pens/
docs/build/html/
80 changes: 80 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
notifications:
email: false
webhooks: https://coveralls.io/webhook?repo_token=COVERALLS_REPO_TOKEN

language: python # this works for Linux but is an error on macOS or Windows
jobs:
include:
- name: "Xenial Linux"
python: 3.8 # this works for Linux but is ignored on macOS or Windows
- name: "macOS"
os: osx
osx_image: xcode11.4
language: shell # 'language: python' is an error on Travis CI macOS
before_install:
- brew install tcl-tk
- python3 --version
- python3 -c "exec(\"import tkinter\\nprint(tkinter.TkVersion)\")"
- name: "Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.8.0
- python -m pip install --upgrade pip
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH

# install dependencies
install:
- pip3 install --upgrade pip # all three OSes agree about 'pip3'
- sudo pip3 install -r requirements.txt || pip3 install -r requirements.txt
- python3 setup.py install || python setup.py install
- pip3 install sphinx
- pip3 install codecov
- pip3 install coveralls

# commands to run tests
script:
# trigger unit tests (time critical and output print limitation due to > 4MB size)
- python3 -m coverage run tests/test_all.py || python -m coverage run tests/test_all.py

after_success:
- coveralls

before_deploy:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
pip3 install --upgrade twine;
python3 setup.py sdist bdist_wheel;
python3 -m twine upload -r testpypi dist/* -u __token__ -p $TEST_PYPI;
pip3 uninstall -y depthy;
pip3 install -i https://test.pypi.org/simple/ depthy;
fi

deploy:
# upload wheel file to PyPi
- provider: pypi
user: __token__
skip_existing: true
distributions: sdist bdist_wheel
server: https://upload.pypi.org/legacy/
password:
secure: L2ygol++aNPpEdidGqJhkMDVVTpXe8kOfHgPUrMLJCh4Y2jq7Xsi2Wklei6yAIwDHXW7RqRcyc1yZ2iQEZpQ6/9ddd1fg6S3lLHWkXrXtpkjfZe3I9BsN+sxKvfXEnb5ISdhOtJcSFHKsOO2DasriVphUvipNvZ7XJHdFnBJMG/6uav2G6ONN5P3PXPbhGs+JJw+WDTlGNUNFP/ujC7IgUfkxBnwjoOG1vLTfeuiMiDdSPnmK2CAT1AK/KKLaAgmFklwnQuPGDBYodEnTcm9TzcS9TVnZbwzgNxwSoLsFwsaqAS4dJaJB5PfmJwEufeGYm0wANPEK06nlWNUaCvX0luJwNPwPHZjKJPS9dBssemEC8Fyj33CD9sQzVz2+E/4wlQ04hTD9MGfTa/74jammYfVb7jyZJ+EBWID69FT45E5wF3KIIC7hPQ2+CuhO10XRtMIlWiWWDcFXOI9V6BrrPYoAh1VwR8/Riaa7jZx/Ft3WxZSVHT9AKG9M0Rc2YorqZ2a6Ud8+TgmXm+/rDPqYnGvsAMQSQLYqqILGzuWgusDl8IENxQ0y1lEF9H06OY2fVjqJDHTjMTkvdzN7OIMw5xaIOdt/TFmdx0F1TyoLEP+n2HkVa6izjun+MIrDfgvEvMb/w3r9ejGUbDZUFjfGRv7lNJ2fVE3ewzqcrmO/qA=
on:
condition: ($TRAVIS_OS_NAME = linux) && ($TRAVIS_BRANCH = master)
tags: false
# upload wheel file to GitHub
- provider: releases
name: Release $TRAVIS_TAG
skip_cleanup: true
api_key:
secure: SA2Zume5ae5tyLHt6ty+GUWE2/XEoiB/GNhpAZBhS73dNKoUq2imLgr4Y1oVHQZHHle9MravJoR6lGFemHdLrxvfGc7auCAlzYcn1JXT/FXp9hq3HBo7OGjnKqJ7l26lmPXBQ9h51AwFvqB05P0RXLKI2BjlTSzP90HD+v+zH1yi99JywMZZpO6B6e9ThTbAm0+ZInw/px0+M1knrpUyyWe7bXE/gRxjwLAAemIv0nhdGtB6vTwJrfabcz3IRZ6H6h/SoVsbHcHBBhFjADPe3LZUnWXsdA6S8/9gkZ3HO6W+AiKM6uFxSIxAo9mhj85J3e+/ftMpa+BL9G4GXUTXMj74EyaD0ml5AsC/pgtYIqcvF8A/PCQ5LmoDJO0UVI6nh66gdzXMS150jFGbzd290pZUtisap2IxarKLMxiGFM10pl4cVJ9ZoT3FaltAGYJs1ston70JznKsCB03aXY20oiSjRFNpPe2bhAoB1L+abgqCq7fHyYx57W2Bewwbg/BXAOtLvmOYJX7MGh7xVgvCmsa5HrxARCe/o8PXXkzVOF51RyfVowsCESngsKcjlUrOAov3oU0owX7JnvD0I9EWlGiqM7Z1H0TYpXHDnoFvRaV0Y1Fw+ktpFwq4PF7m8IWJHRqfd+8chaDgjgVVmOurJlR6dKE+C3YxXHdNglxPTM=
file_glob: true
file:
- dist/*.whl
- dist/*.tar.gz
- dist/*.egg
draft: true
on:
repo: hahnec/depthy
condition: $TRAVIS_OS_NAME = linux
tags: false
all_branches: true
122 changes: 122 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
======
depthy
======

Description
-----------

*depthy* enables depth map generation from light-fields.

|release| |build| |coverage| |pypi_total| |pypi|

Results
-------

|vspace|

.. list-table::
:widths: 8 8 8 8
:header-rows: 0
:stub-columns: 1

* - Central view
- |photo_ref_1|
- |photo_ref_2|
- |photo_ref_3|
* - Depth map
- |depth_map_1|
- |depth_map_2|
- |depth_map_3|

|
Installation
------------

* via pip:
1. install with ``pip3 install depthy``
2. type ``depthy -h`` to the command line once installation finished

* from source:
1. install Python from https://www.python.org/
2. download the source_ using ``git clone https://github.com/hahnec/depthy.git``
3. go to the root directory ``cd depthy``
4. load dependencies ``$ pip3 install -r requirements.txt``
5. install with ``python3 setup.py install``
6. if installation ran smoothly, enter ``depthy -h`` to the command line

Command Line Usage
==================

From the root directory of your downloaded repo, you can run the tool on the provided test data by

``depthy -s './examples/data/pens/'``

on a UNIX system where the result is found at ``./examples/data/``. A windows equivalent of the above command is

``depthy --src=".\\examples\\data\\pens\\"``

Alternatively, you can specify the method or select your images manually with

``depthy --win --method='epi'``

More information on optional arguments, can be found using the help parameter

``depthy -h``

Author
------

`Christopher Hahne <http://www.christopherhahne.de/>`__

.. Hyperlink aliases
.. _source: https://github.com/hahnec/depthy/archive/master.zip

.. |photo_ref_1| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/pens_040.png" width="200px" max-width:"100%">

.. |photo_ref_2| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/herbs_040.png" width="200px" max-width:"100%">

.. |photo_ref_3| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/boxes_040.png" width="200px" max-width:"100%">

.. |depth_map_1| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/pens.png" width="200px" max-width:"100%">

.. |depth_map_2| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/herbs.png" width="200px" max-width:"100%">

.. |depth_map_3| raw:: html

<img src="https://raw.githubusercontent.com/hahnec/depthy/master/docs/img/boxes.png" width="200px" max-width:"100%">

.. |vspace| raw:: latex

\vspace{1mm}

.. Image substitutions
.. |release| image:: https://img.shields.io/github/v/release/hahnec/depthy?style=square
:target: https://github.com/hahnec/depthy/releases/
:alt: release

.. |build| image:: https://img.shields.io/travis/com/hahnec/depthy?style=square
:target: https://travis-ci.com/github/hahnec/depthy

.. |coverage| image:: https://img.shields.io/coveralls/github/hahnec/depthy?style=square
:target: https://coveralls.io/github/hahnec/depthy

.. |pypi| image:: https://img.shields.io/pypi/dm/depthy?label=PyPI%20downloads&style=square
:target: https://pypi.org/project/depthy/
:alt: PyPI Downloads

.. |pypi_total| image:: https://pepy.tech/badge/depthy?style=flat-square
:target: https://pepy.tech/project/depthy
:alt: PyPi Dl2
Loading

0 comments on commit a73a9a5

Please sign in to comment.