Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.

Commit c6a8d70

Browse files
committed
Add sphinx documentation
1 parent 955c01d commit c6a8d70

File tree

12 files changed

+555
-76
lines changed

12 files changed

+555
-76
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.pyc
2+
docs/.build
23
dataset_loaders.egg-info
34
dataset_loaders/datasets
45
.cache

README.md

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,13 @@ for image and video semantic segmentation. The framework can perform some
33
on-the-fly preprocessing/data augmentation, as well as run on multiple threads
44
(if enabled) to speed up the I/O operations.
55

6-
NEWS: You might be interested in checking out [Main loop TF](https://github.com/fvisin/main_loop_tf), a python main loop that integrates the *Dataset loaders* with Tensorflow!
6+
**NEWS:** You might be interested in checking out
7+
[Main loop TF](https://github.com/fvisin/main_loop_tf), a python main loop that integrates the *Dataset loaders* with Tensorflow!
78

89
### Attribution
910
If you use this code, please cite:
10-
* \[1\] Francesco Visin, Adriana Romero - Dataset loaders: a python library to
11-
load and preprocess datasets ([BibTeX](
12-
https://gist.github.com/fvisin/7104500ae8b33c3b65798d5d2707ce6c#file-dataset_loaders-bib))
11+
* \[1\] Francesco Visin, Adriana Romero, *Dataset loaders: a python library to
12+
load and preprocess datasets* ([BibTeX](
13+
https://gist.github.com/fvisin/7104500ae8b33c3b65798d5d2707ce6c#file-dataset_loaders-bib))
1314

14-
### How to install it:
15-
1. Clone the repository with `--recursive` in some path, e.g. to your `$HOME`:
16-
17-
```sh
18-
git clone --recursive https://github.com/fvisin/dataset_loaders.git "$HOME/dataset_loaders"
19-
```
20-
21-
2. Install the package:
22-
23-
```sh
24-
pip install [--user] -e <dataset_loaders path>
25-
```
26-
27-
3. The framework assumes that the datasets are stored in some *shared paths*,
28-
accessible by everyone, and should be copied locally on the machines that
29-
run the experiments. The framework automatically takes care for you to copy
30-
the datasets from the *shared paths* to a *local path*.
31-
32-
Create a configuration file with these paths in
33-
`/dataset_loaders/dataset_loaders/config.ini` (see the
34-
[config.ini.example](dataset_loaders/config.ini.example) in the same
35-
directory for guidance).
36-
37-
Note: if you want to disable the copy mechanism, just specify the same path
38-
for the local and the shared path:
39-
40-
```ini
41-
[general]
42-
datasets_local_path = /a/local/path
43-
[camvid]
44-
shared_path = /a/local/path/camvid
45-
[cityscapes]
46-
shared_path = /a/local/path/cityscapes/
47-
(and so on...)
48-
```
49-
50-
4. To use the MS COCO dataset, you also need to do the following:
51-
52-
```sh
53-
cd dataset_loaders/images/coco/PythonAPI
54-
make all
55-
```
56-
57-
4. You will need to install
58-
[SimpleITK](https://itk.org/Wiki/SimpleITK/GettingStarted#Generic_Distribution)
59-
and [openCV](http://opencv.org/) if you intend to use the *warp_spline* or
60-
the *optical flow* data augmentations respectively.
61-
</br>
62-
63-
### Notes
64-
* **The code is provided as is, please expect minimal-to-none support on it.**
65-
* This framework is provided for research purposes only. Although we tried our
66-
best to test it, the code might be bugged or unstable. Use it at your own
67-
risk!
68-
* The framework currently supports image or video based datasets. It could be
69-
easily extended to support other kinds of data (e.g., text corpora), but
70-
there is no plan on our side to work on that at the moment.
71-
* Feel free to contribute to the code with a PR if you find bugs, want to
72-
improve the existing code or add support for other datasets.
73-
74-
75-
</br>
76-
</br>
77-
</br>
78-
79-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
80-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
81-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
82-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
83-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
84-
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
85-
PERFORMANCE OF THIS SOFTWARE.
15+
Check the full documentation on: http://dataset_loaders.readthedocs.io

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = Datasetloaders
8+
SOURCEDIR = .
9+
BUILDDIR = .build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _api:
2+
3+
API
4+
===
5+
6+
.. toctree::
7+
8+
parallel_loader
9+
images
10+
videos
11+
utilities
12+

docs/conf.py

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Dataset loaders documentation build configuration file, created by
4+
# sphinx-quickstart on Thu Jun 22 11:26:05 2017.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#
19+
# import os
20+
# import sys
21+
# sys.path.insert(0, os.path.abspath('.'))
22+
23+
import os
24+
import sys
25+
from recommonmark.parser import CommonMarkParser
26+
import sphinx_rtd_theme
27+
28+
import dataset_loaders
29+
30+
# Use read the docs theme locally
31+
html_theme = "sphinx_rtd_theme"
32+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
33+
34+
# Parse Markdown syntax
35+
source_parsers = {
36+
'.md': CommonMarkParser,
37+
}
38+
39+
# The suffix(es) of source filenames.
40+
# You can specify multiple suffix as a list of string:
41+
#
42+
source_suffix = ['.rst', '.md']
43+
44+
45+
# -- General configuration ------------------------------------------------
46+
47+
# If your documentation needs a minimal Sphinx version, state it here.
48+
#
49+
# needs_sphinx = '1.0'
50+
51+
# Add any Sphinx extension module names here, as strings. They can be
52+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
53+
# ones.
54+
extensions = ['sphinx.ext.autodoc',
55+
'sphinx.ext.intersphinx',
56+
'sphinx.ext.mathjax',
57+
'sphinx.ext.viewcode',
58+
'sphinx.ext.githubpages',
59+
# 'sphinx.ext.todo',
60+
# 'sphinx.ext.doctest',
61+
'sphinx.ext.napoleon',
62+
'sphinx.ext.linkcode']
63+
# 'sphinxcontrib.napoleon']
64+
65+
napoleon_google_docstring = False
66+
napoleon_include_special_with_doc = False
67+
68+
# Add any paths that contain templates here, relative to this directory.
69+
templates_path = ['.templates']
70+
71+
# The master toctree document.
72+
master_doc = 'index'
73+
74+
# General information about the project.
75+
project = u'Dataset loaders'
76+
copyright = u'2017, Francesco Visin and Adriana Romero'
77+
author = u'Francesco Visin and Adriana Romero'
78+
79+
# The version info for the project you're documenting, acts as replacement for
80+
# |version| and |release|, also used in various other places throughout the
81+
# built documents.
82+
#
83+
# The short X.Y version.
84+
version = u'1.0'
85+
# The full version, including alpha/beta/rc tags.
86+
release = u'1.0'
87+
88+
# The language for content autogenerated by Sphinx. Refer to documentation
89+
# for a list of supported languages.
90+
#
91+
# This is also used if you do content translation via gettext catalogs.
92+
# Usually you set "language" from the command line for these cases.
93+
language = None
94+
95+
# List of patterns, relative to source directory, that match files and
96+
# directories to ignore when looking for source files.
97+
# This patterns also effect to html_static_path and html_extra_path
98+
exclude_patterns = ['.build', 'Thumbs.db', '.DS_Store']
99+
100+
# The name of the Pygments (syntax highlighting) style to use.
101+
pygments_style = 'sphinx'
102+
103+
# If true, `todo` and `todoList` produce output, else they produce nothing.
104+
todo_include_todos = False
105+
106+
107+
# Options for the linkcode extension
108+
# ----------------------------------
109+
# Resolve function
110+
# This function is used to populate the (source) links in the API
111+
def linkcode_resolve(domain, info):
112+
def find_source():
113+
# try to find the file and line number, based on code from numpy:
114+
# https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286
115+
obj = sys.modules[info['module']]
116+
for part in info['fullname'].split('.'):
117+
obj = getattr(obj, part)
118+
import inspect
119+
fn = inspect.getsourcefile(obj)
120+
fn = os.path.relpath(fn,
121+
start=os.path.dirname(dataset_loaders.__file__))
122+
source, lineno = inspect.getsourcelines(obj)
123+
return fn, lineno, lineno + len(source) - 1
124+
125+
if domain != 'py' or not info['module']:
126+
return None
127+
try:
128+
filename = 'dataset_loaders/%s#L%d-L%d' % find_source()
129+
except Exception:
130+
filename = info['module'].replace('.', '/') + '.py'
131+
import subprocess
132+
tag = subprocess.Popen(['git', 'rev-parse', 'HEAD'],
133+
stdout=subprocess.PIPE,
134+
universal_newlines=True).communicate()[0][:-1]
135+
return "https://github.com/fvisin/dataset_loaders/blob/%s/%s" % (tag, filename)
136+
137+
138+
# -- Options for HTML output ----------------------------------------------
139+
140+
# The html-style
141+
#
142+
# html_style = '/default.css'
143+
144+
# The theme to use for HTML and HTML Help pages. See the documentation for
145+
# a list of builtin themes.
146+
#
147+
# Read the docs style:
148+
if os.environ.get('READTHEDOCS') != 'True':
149+
try:
150+
import sphinx_rtd_theme
151+
except ImportError:
152+
pass # assume we have sphinx >= 1.3
153+
else:
154+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
155+
html_theme = 'sphinx_rtd_theme'
156+
157+
# Theme options are theme-specific and customize the look and feel of a theme
158+
# further. For a list of options available for each theme, see the
159+
# documentation.
160+
#
161+
# html_theme_options = {}
162+
163+
# Add any paths that contain custom static files (such as style sheets) here,
164+
# relative to this directory. They are copied after the builtin static files,
165+
# so a file named "default.css" will overwrite the builtin "default.css".
166+
html_static_path = ['.static']
167+
168+
# If true, SmartyPants will be used to convert quotes and dashes to
169+
# typographically correct entities.
170+
html_use_smartypants = True
171+
172+
173+
# -- Options for HTMLHelp output ------------------------------------------
174+
175+
# Output file base name for HTML help builder.
176+
htmlhelp_basename = 'Datasetloadersdoc'
177+
178+
179+
# -- Options for LaTeX output ---------------------------------------------
180+
181+
latex_elements = {
182+
# The paper size ('letterpaper' or 'a4paper').
183+
#
184+
# 'papersize': 'letterpaper',
185+
186+
# The font size ('10pt', '11pt' or '12pt').
187+
#
188+
# 'pointsize': '10pt',
189+
190+
# Additional stuff for the LaTeX preamble.
191+
#
192+
# 'preamble': '',
193+
194+
# Latex figure (float) alignment
195+
#
196+
# 'figure_align': 'htbp',
197+
}
198+
199+
# Grouping the document tree into LaTeX files. List of tuples
200+
# (source start file, target name, title,
201+
# author, documentclass [howto, manual, or own class]).
202+
latex_documents = [
203+
(master_doc, 'Datasetloaders.tex', u'Dataset loaders Documentation',
204+
u'Francesco Visin and Adriana Romero', 'manual'),
205+
]
206+
207+
208+
# -- Options for manual page output ---------------------------------------
209+
210+
# One entry per manual page. List of tuples
211+
# (source start file, name, description, authors, manual section).
212+
man_pages = [
213+
(master_doc, 'datasetloaders', u'Dataset loaders Documentation',
214+
[author], 1)
215+
]
216+
217+
218+
# -- Options for Texinfo output -------------------------------------------
219+
220+
# Grouping the document tree into Texinfo files. List of tuples
221+
# (source start file, target name, title, author,
222+
# dir menu entry, description, category)
223+
texinfo_documents = [
224+
(master_doc, 'Datasetloaders', u'Dataset loaders Documentation',
225+
author, 'Datasetloaders', 'One line description of project.',
226+
'Miscellaneous'),
227+
]
228+
229+
# Example configuration for intersphinx: refer to the Python standard library.
230+
# intersphinx_mapping = {'https://docs.python.org/': None}

0 commit comments

Comments
 (0)