Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev env using baremetal conda. #10

Merged
merged 1 commit into from Sep 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ torchgeometry.egg-info/
.eggs/*
.cache/*
.pytest_cache/*
.dev_env
30 changes: 26 additions & 4 deletions README.rst
@@ -1,4 +1,3 @@

.. image:: https://github.com/arraiy/torchgeometry/blob/master/docs/source/_static/img/torchgeometry_logo.svg
:width: 350 px
:align: center
Expand Down Expand Up @@ -31,7 +30,7 @@ Quick Usage
x_deg = dgm.rad2deg(x_rad)

torch.allclose(x_rad, dgm.deg2rad(x_deg)) # True

-------------------------------------------------------

.. code:: python
Expand All @@ -44,8 +43,31 @@ Quick Usage

warper = dgm.HomographyWarper(32, 32)
img_ref_to_dst = warper(img_ref, dst_homo_ref) # NxCxHxW




Development Setup
=================

Assuming that you are on ubuntu 16.04, with nvidia-drivers installed.

In bash, source the ``path.bash.inc`` script. This will install a
local conda environment under ``./.dev_env``, which includes pytorch
and some dependencies (no root required).

.. code:: bash

source ./path.bash.inc
python -c "import torchgeometry; print(torchgeometry.__version__)"



To install, or update the conda environment run ``setup_dev_env.sh``

.. code:: bash

./setup_dev_env.sh


Installation
============

Expand Down
41 changes: 0 additions & 41 deletions dev_env.sh

This file was deleted.

15 changes: 15 additions & 0 deletions path.bash.inc
@@ -0,0 +1,15 @@
# The purpose of this script is simplify running scripts inside of our
# dev_env docker container. It mounts the workspace and the
# workspace/../build directory inside of the container, and executes
# any arguments passed to the dev_env.sh
script_link="$( readlink "$BASH_SOURCE" )" || script_link="$BASH_SOURCE"
apparent_sdk_dir="${script_link%/*}"
if [ "$apparent_sdk_dir" == "$script_link" ]; then
apparent_sdk_dir=.
fi
sdk_dir="$( command cd -P "$apparent_sdk_dir" > /dev/null && pwd -P )"
if [ ! -e $sdk_dir/.dev_env/bin/conda ]; then
$sdk_dir/setup_dev_env.sh
fi
source $sdk_dir/.dev_env/bin/activate $sdk_dir/.dev_env
export PYTHONPATH=$PYTHONPATH:$sdk_root
29 changes: 29 additions & 0 deletions setup_dev_env.sh
@@ -0,0 +1,29 @@
#!/bin/bash -ex
script_link="$( readlink "$BASH_SOURCE" )" || script_link="$BASH_SOURCE"
apparent_sdk_dir="${script_link%/*}"
if [ "$apparent_sdk_dir" == "$script_link" ]; then
apparent_sdk_dir=.
fi
sdk_dir="$( command cd -P "$apparent_sdk_dir" > /dev/null && pwd -P )"

mkdir -p $sdk_dir/.dev_env

if [ ! -e $sdk_dir/.dev_env/miniconda.sh ]; then
curl -o $sdk_dir/.dev_env/miniconda.sh \
-O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x $sdk_dir/.dev_env/miniconda.sh
fi
if [ ! -e $sdk_dir/.dev_env/bin/conda ]; then
$sdk_dir/.dev_env/miniconda.sh -b -u -p $sdk_dir/.dev_env
fi

$sdk_dir/.dev_env/bin/conda install -y \
ipython \
numpy \
pytorch \
torchvision \
opencv \
-c pytorch

$sdk_dir/.dev_env/bin/conda clean -ya