Skip to content

Commit

Permalink
Merge pull request #179 from CosmiQ/dev
Browse files Browse the repository at this point in the history
Version 0.1.0 release
  • Loading branch information
nrweir authored Jun 28, 2019
2 parents cf7054b + c36455b commit f2fe193
Show file tree
Hide file tree
Showing 429 changed files with 6,393 additions and 27,744 deletions.
8 changes: 8 additions & 0 deletions .readthedocs-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: solaris
dependencies:
- python
- pip
- gdal
- pip:
- sphinx_bootstrap_theme
- nbsphinx
17 changes: 17 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
formats:
- htmlzip

python:
version: 3.6
install:
- method: pip
path: .
- requirements: .rtfd-requirements.txt


conda:
environment: .readthedocs-environment.yml

build:
image: latest
1 change: 1 addition & 0 deletions .rtfd-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx_bootstrap_theme
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,58 @@
<a href="https://codecov.io/gh/CosmiQ/solaris"><img align="center" src="https://codecov.io/gh/CosmiQ/solaris/branch/master/graph/badge.svg" /></a>
</p>

## This package is under active development. Check back soon for updates!
## This is a beta version of Solaris which may continue to develop. Please report any bugs through issues!

- [Documentation](#documentation)
- [Installation Instructions](#installation-instructions)
- [Dependencies](#dependencies)
- [License](#license)
---

This repository provides the source code for the CosmiQ Works `solaris` project, which provides software tools for:
- Tiling large-format overhead images and vector labels
- Converting between geospatial raster and vector formats and machine learning-compatible formats
- Performing semantic and instance segmentation, object detection, and related tasks using deep learning models designed specifically for overhead image analysis
- Evaluating performance of deep learning model predictions

## Documentation
The full documentation for `solaris` can be found at https://solaris.readthedocs.io, and includes:
- A summary of `solaris`
- Installation instructions
- API Documentation
- Tutorials for common uses

The documentation is still being improved, so if a tutorial you need isn't there yet, check back soon or post an issue!

## Installation Instructions

_coming soon_: One-command installation from conda-forge.

We recommend creating a `conda` environment with the dependencies defined in [environment.yml](./environment.yml) before installing `solaris`. After cloning the repository:
```
cd solaris
```

If you're installing on a system with GPU access:
```
conda env create -n solaris -f environment-gpu.yml
```
Otherwise:
If you're installing on a system with GPU access:
```
conda env create -n solaris -f environment.yml
```

Finally, regardless of your installation environment:
```
conda activate solaris
pip install .
```

#### pip

The package also exists on[ PyPI](https://pypi.org), but note that some of the dependencies, specifically [rtree](https://github.com/Toblerity/) and [gdal](https://www.gdal.org), are challenging to install without anaconda. We therefore recommend installing at least those dependencies using `conda` before installing from PyPI.

The package also exists on[ PyPI](https://pypi.org), but note that some of the dependencies, specifically [rtree](https://github.com/Toblerity/rtree) and [gdal](https://www.gdal.org), are challenging to install without anaconda. We therefore recommend installing at least those dependency using `conda` before installing from PyPI.

```
conda install -c conda-forge rtree gdal=2.4.1
Expand All @@ -60,7 +88,7 @@ docker pull cosmiqworks/solaris
See the [readthedocs](https://cw-eval.readthedocs.io/) page. -->

## Dependencies
All dependencies can be found in the docker file [Dockerfile](./Dockerfile) or
All dependencies can be found in the requirements file [./requirements.txt](requirements.txt) or
[environment.yml](./environment.yml)

## License
Expand Down
79 changes: 79 additions & 0 deletions docker/cpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
FROM nvidia/cuda:9.2-devel-ubuntu16.04
LABEL maintainer="nweir <[email protected]>"

ARG solaris_branch='master'


# prep apt-get and cudnn
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
rm -rf /var/lib/apt/lists/*

# install requirements
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bc \
bzip2 \
ca-certificates \
curl \
git \
libgdal-dev \
libssl-dev \
libffi-dev \
libncurses-dev \
libgl1 \
jq \
nfs-common \
parallel \
python-dev \
python-pip \
python-wheel \
python-setuptools \
unzip \
vim \
wget \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

SHELL ["/bin/bash", "-c"]
ENV PATH /opt/conda/bin:$PATH

# install anaconda
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc

# prepend pytorch and conda-forge before default channel
RUN conda update conda && \
conda config --prepend channels conda-forge && \
conda config --prepend channels pytorch

# get dev version of solaris and create conda environment based on its env file
WORKDIR /tmp/
RUN git clone https://github.com/cosmiq/solaris.git && \
cd solaris && \
git checkout ${solaris_branch} && \
conda env create -f environment.yml
ENV PATH /opt/conda/envs/solaris/bin:$PATH

RUN cd solaris && pip install .

# install various conda dependencies into the space_base environment
RUN conda install -n solaris \
jupyter \
jupyterlab \
ipykernel

# add a jupyter kernel for the conda environment in case it's wanted
RUN source activate solaris && python -m ipykernel.kernelspec \
--name solaris --display-name solaris

# open ports for jupyterlab and tensorboard
EXPOSE 8888 6006

RUN ["/bin/bash"]
2 changes: 1 addition & 1 deletion docker/Dockerfile → docker/gpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ WORKDIR /tmp/
RUN git clone https://github.com/cosmiq/solaris.git && \
cd solaris && \
git checkout ${solaris_branch} && \
conda env create -f environment.yml
conda env create -f environment-gpu.yml
ENV PATH /opt/conda/envs/solaris/bin:$PATH

RUN cd solaris && pip install .
Expand Down
15 changes: 15 additions & 0 deletions docs/_static/custom_styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
p {
font-size: 1.1em;
}

h1 {
font-size: 2.5em;
}

h2 {
font-size: 2.2em;
}

h3 {
font-size: 1.75em;
}
Binary file added docs/_static/solaris_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/solaris_logo_tiny_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
29 changes: 29 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: Methods

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
36 changes: 36 additions & 0 deletions docs/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block functions %}
{% if functions %}
.. rubric:: Functions

.. autosummary::
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: Exceptions

.. autosummary::
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
7 changes: 7 additions & 0 deletions docs/_templates/base/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. {{ obj.type }}:: {{ obj.name }}
{% if summary %}
{{ obj.summary }}
{% endif %}
88 changes: 88 additions & 0 deletions docs/_templates/dotnet/base_detail.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{% block title %}

{{ obj.short_name }} {{ obj.type.title()}}
{{ "=" * (obj.short_name|length + obj.type|length + 1) }}

{% endblock %}

{% block summary %}
{% if obj.summary %}

{{ obj.summary }}

{% endif %}
{% endblock %}

{% if obj.namespace %}
Namespace
:dn:ns:`{{ obj.namespace }}`

{% endif %}
{% if obj.assemblies %}
Assemblies
{% for assembly in obj.assemblies %}
* {{ assembly }}
{% endfor %}
{% endif %}

----

.. contents::
:local:

{% block inheritance %}

{% if obj.inheritance %}

Inheritance Hierarchy
---------------------

{% for item in obj.inheritance %}
* :dn:{{ item.ref_directive }}:`{{ item.ref_name }}`
{% endfor %}
* :dn:{{ obj.ref_directive }}:`{{ obj.ref_name }}`
{% endif %}

{% endblock %}

{% block syntax %}

{% if obj.example %}

Syntax
------

.. code-block:: csharp
{{ obj.example|indent(4) }}
{% endif %}

{% endblock %}


{% block content %}

.. dn:{{ obj.ref_type }}:: {{ obj.definition }}
:hidden:

.. dn:{{ obj.ref_type }}:: {{ obj.name }}
{% for item_type in obj.item_map.keys() %}
{% if item_type in obj.item_map %}

{{ item_type.title() }}
{{ "-" * item_type|length }}

.. dn:{{ obj.ref_type }}:: {{ obj.name }}
:noindex:
:hidden:

{% for obj_item in obj.item_map.get(item_type, []) %}
{{ obj_item.render()|indent(4) }}
{% endfor %}

{% endif %}
{% endfor %}

{% endblock %}
Loading

0 comments on commit f2fe193

Please sign in to comment.