changtimwu / changtimwu.github.com

Tim's testing/practice notes
7 stars 2 forks source link

Python DL environment #66

Open changtimwu opened 7 years ago

changtimwu commented 7 years ago

OSX:

python3

brew install python3

Anaconda on python3

Be patient on the anaconda. It saves lots of time even though it requires some tweaks. https://github.com/udacity/CarND-Term1-Starter-Kit/blob/master/doc/configure_via_anaconda.md

python notebook on python3

pip3 install notebook
changtimwu commented 7 years ago

http://www.pyimagesearch.com/2016/12/19/install-opencv-3-on-macos-with-homebrew-the-easy-way/

opencv:

pip3 install opencv-python

test if this really works

import cv2

do not use conda since its opencv is still broken https://github.com/conda/conda/issues/2448

changtimwu commented 7 years ago

install moviepy

http://zulko.github.io/moviepy/install.html

pip3 install moviepy pygame
pip3 install scipy scikit-image scikit-video

even though it says The software FFMPEG should be automatically downloaded/installed (by imageio) during your first use of MoviePy (it takes a few seconds).

from moviepy.editor import VideoFileClip

still fails on my env.

Please manually install ffmpeg

brew install ffmpeg
changtimwu commented 7 years ago

install tensorflow

if conda installation of tensorflow doesn't work

pip3 install tensorflow
pip3 install tensorflow-gpu
changtimwu commented 7 years ago

be familiar with numpy since ndarray is the default image type. https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray

>>> import matplotlib.image as mpimg
>>> import numpy as np
>>> import cv2
>>> image = mpimg.imread('exit-ramp.jpg')
>>> image.dtype
dtype('uint8')
>>> image.shape
(540, 960, 3)
changtimwu commented 6 years ago

opencv https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_tutorials.html