Commit b729a3ed authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'python38' into 'master'

Support for python-3.8

See merge request bob/bob.conda!443
parents 11f85a1f a019be6e
Pipeline #44583 passed with stage
in 32 minutes and 14 seconds
{% set name = "aniso8601" %}
{% set version = "4.0.1" %}
{% set sha256 = "e7560de91bf00baa712b2550a2fdebf0188c5fce2fcd1162fbac75c19bb29c95" %}
package:
name: {{ name }}
version: {{ version }}
source:
fn: {{ name }}-{{ version }}.tar.gz
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: {{ sha256 }}
build:
number: 0
script: python -m pip install --no-deps --ignore-installed .
requirements:
build:
- pip
- python
- setuptools
run:
- python
- python-dateutil
test:
imports:
- aniso8601
about:
home: https://bitbucket.org/nielsenb/aniso8601
license: BSD 3-Clause
summary: A library for parsing ISO 8601 strings.
extra:
recipe-maintainers:
- anjos
{% set name = "aspy.yaml" %}
{% set version = "1.1.1" %}
{% set file_ext = "tar.gz" %}
{% set hash_type = "sha256" %}
{% set hash_value = "0a77e23fafe7b242068ffc0252cee130d3e509040908fc678d9d1060e7494baa" %}
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
fn: '{{ name }}-{{ version }}.{{ file_ext }}'
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
'{{ hash_type }}': '{{ hash_value }}'
build:
number: 0
entry_points:
- identify-cli=identify.cli:main
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv"
requirements:
host:
- pip
- python
- setuptools
run:
- python
- pyyaml
test:
imports:
- aspy
- aspy.yaml
about:
home: https://github.com/asottile/aspy.yaml
license: MIT
license_family: MIT
summary: A few extensions to pyyaml.
extra:
recipe-maintainers: sgaist
......@@ -18,11 +18,11 @@ requirements:
- python {{ python }}
- docker-py 4.2.0
- jsonschema 3.2.0
- ncurses 6.2
- python-graphviz 0.13.2
- pyzmq 18.1.1
- simplejson 3.17.0
- sphinxcontrib-httpdomain 1.7.0
- ncurses 6.2
run:
- python
run_constrained:
......
......@@ -23,72 +23,59 @@ requirements:
# Dependency list of bob packages. Everything is pinned to allow for better
# reproducibility.
- boost 1.67.0
- caffe 1.0 # [linux]
- click 7.1.1
- click-plugins 1.1.1
- cmake 3.14.0
- coverage 5.0
- cyvlfeat 0.5.1
- docopt 0.6.2
# to make sure we get ffmpeg from our own channel which has more codecs
- ffmpeg 4.0 hadceb68_1 # [linux]
- ffmpeg 4.0 h2047f9e_1 # [osx]
- freetype 2.9.1
- giflib 5.1.4
- h5py 2.8.0
- hdf5 1.10.2
- jinja2 2.11.1
- jpeg 9b
- kaldi 5.5.164 # [linux]
- libblitz 1.0.1
- libmatio 1.5.17
- libogg 1.3.2
- libpng 1.6.37
- libsvm 3.24
- libtiff 4.1.0
- matplotlib 3.1.3
- menpo 0.9.2
- menpofit 0.6.1
- mkl 2019.4
- mne 0.18.1
- mr.developer 2.0.0
- nose 1.3.7
- numpy 1.18.1
- opencv 3.4.2
- pillow 6.2.1
- pkg-config 0.29.2
- pyedflib 0.1.14
- cudatoolkit 10.0 # [linux]
- pandas 1.0.3
- pytorch 1.3.1
- pyyaml 5.3.1
- requests 2.23.0
- schema 0.7.1
- scikit-image 0.16.2
- scikit-learn 0.22.1
- scipy 1.4.1
- setuptools 46.1.1
- six 1.14.0
- sox 14.4.2
- sphinx 2.4.4
- sphinx_rtd_theme 0.4.3
- sphinxcontrib-programoutput 0.16
- sqlalchemy 1.3.15
- tabulate 0.8.3
- tensorflow 1.15.0
- torchvision 0.4.2 # [linux]
- tqdm 4.43.0
- vlfeat 0.9.21
- zc.buildout 2.13.3
- zc.recipe.egg 2.0.7
- boost
- click
- click-plugins
- cmake
- coverage
- docopt
- ffmpeg
- freetype
- giflib
- h5py
- hdf5
- jinja2
- jpeg
- libblitz
- libmatio
- libpng
- libsvm
- libtiff
- matplotlib
- mkl
- nose
- numpy
- opencv
- pandas
- pillow
- pkg-config
- pybind11
- pytorch
- pyyaml
- requests
- schema
- scikit-image
- scikit-learn
- scipy
- setuptools
- six
- sox
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-programoutput
- sqlalchemy
- tabulate
- tensorflow
- torchvision
- tqdm
- vlfeat
- zc.buildout
- zc.recipe.egg
# beat-devel direct dependencies that leak to bob-devel as indirect
# dependencies:
- termcolor 1.1.0
- psycopg2 2.8.4
- termcolor
- psycopg2
# semi-supported dependencies (drop them if they conflict):
- dlib 19.7
- pybind11 2.4.3
run:
- python
run_constrained:
......@@ -102,8 +89,8 @@ test:
requires:
- numpy
- ffmpeg
- pytorch # [linux]
- torchvision # [linux]
- pytorch
- torchvision
commands:
# we expect these features from ffmpeg:
- ffmpeg -codecs | grep "DEVI.S zlib" # [unix]
......
{% set name = "cfgv" %}
{% set version = "1.4.0" %}
{% set file_ext = "tar.gz" %}
{% set hash_type = "sha256" %}
{% set hash_value = "39d9055c47e3932908fe25abd5807e21dc002630db01c7a5f05738d027e2b706" %}
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
fn: '{{ name }}-{{ version }}.{{ file_ext }}'
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
'{{ hash_type }}': '{{ hash_value }}'
build:
number: 0
entry_points:
- identify-cli=identify.cli:main
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv"
requirements:
host:
- pip
- python
build:
- six
run:
- python
- six
test:
imports:
- cfgv
about:
home: https://github.com/asottile/cfgv
license: MIT
license_family: MIT
summary: Validate configuration and produce human readable error messages.
extra:
recipe-maintainers: sgaist
"%PYTHON%" setup.py install --single-version-externally-managed --record=%TEMP%record.txt
if errorlevel 1 exit 1
#!/bin/sh
if [ "$(uname)" == "Linux" ]; then
CFLAGS="${CFLAGS} -I${CONDA_PREFIX}/include" LDFLAGS="-L${CONDA_PREFIX}/lib -lvl -Wl,-rpath=${CONDA_PREFIX}/lib "
else
CFLAGS="${CFLAGS} -I${CONDA_PREFIX}/include" LDFLAGS="-L${CONDA_PREFIX}/lib -lvl "
fi
"$PYTHON" setup.py install --single-version-externally-managed --record=record.txt
if [ "$(uname -s)" == "Darwin" ]; then
# For some reason Cython refuses to generate @rpath/vlfeat.dylib - so
# we manually do it here
find $SP_DIR/cyvlfeat -name "*.so" -print0 | while read -d $'\0' file
do
install_name_tool -change @loader_path/libvl.dylib @rpath/libvl.dylib $file
done
fi
This diff is collapsed.
{% set name = "cyvlfeat" %}
{% set version = "0.5.1" %}
{% set sha256 = "816d0609c5f5a1b4e4a620a9cb204abe26c8cd6a166d077923242f6cf15c2c09" %}
package:
name: {{ name }}
version: {{ version }}
source:
fn: {{ name }}-v{{ version }}.tar.gz
url: https://github.com/menpo/cyvlfeat/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
build:
number: 1
requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- setuptools {{ setuptools }}
- cython {{ cython }}
- numpy {{ numpy }}
- vlfeat {{ vlfeat }}
run:
- python
- {{ pin_compatible('numpy') }}
test:
requires:
- nose
- pytest
- coverage
imports:
- cyvlfeat.sift.sift
- cyvlfeat.sift.dsift
- cyvlfeat.fisher.fisher
- cyvlfeat.hog.hog
- cyvlfeat.kmeans.kmeans
- cyvlfeat.generic.generic
commands:
- nosetests {{ name }} -v --cover-package={{ name }}
- conda inspect linkages -p $PREFIX {{ name }} # [not win]
- conda inspect objects -p $PREFIX {{ name }} # [osx]
about:
home: https://github.com/menpo/cyvlfeat/
summary: A thin Cython wrapper around select areas of vlfeat
license: BSD
extra:
recipe-maintainers:
- anjos
......@@ -13,7 +13,7 @@ source:
sha256: {{ sha256 }}
build:
number: 1
number: 2
script: python -m pip install --no-deps --ignore-installed .
requirements:
......
The images face.jpg/face.png are used under the Creative Commons 2.0 License,
which can be found here:
https://creativecommons.org/licenses/by/2.0/
The image was found on Flickr under the following URL:
https://flic.kr/p/x1TgvF
and was provided by user Jane Kostenko (layma1999):
https://www.flickr.com/photos/133533365@N06/
The "medium" version of the image was downloaded on 21/07/2016 and was modified
only via reencoding to png.
The intended use of this image is for testing purposes only.
@echo ON
mkdir build
cd build
rem The Python lib has no period in the version string, so we remove it here.
set PY_VER_NO_DOT=%PY_VER:.=%
rem Required as the png locator does some processing that chokes on \
set "PNG_LIBRARY=%LIBRARY_LIB%\libpng16.lib"
set "PNG_LIBRARY=%PNG_LIBRARY:\=/%"
rem There is a bug whereby linking to jpeg causes a link crash, so we allow
rem dlib to build it
cmake ..\tools\python -LAH -G"NMake Makefiles" ^
-DCMAKE_BUILD_TYPE="Release" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DBoost_USE_STATIC_LIBS=0 ^
-DBoost_USE_STATIC_RUNTIME=0 ^
-DBOOST_ROOT="%LIBRARY_PREFIX%" ^
-DBOOST_INCLUDEDIR="%LIBRARY_INC%" ^
-DBOOST_LIBRARYDIR="%LIBRARY_LIB%" ^
-DPYTHON3=%PY3K% ^
-DPYTHON_LIBRARY="%PREFIX%\libs\python%PY_VER_NO_DOT%.lib" ^
-DPYTHON_INCLUDE_DIR="%PREFIX%\include" ^
-DDLIB_LINK_WITH_SQLITE3=0 ^
-DDLIB_PNG_SUPPORT=1 ^
-DPNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DPNG_PNG_INCLUDE_DIR="%LIBRARY_INC%" ^
-DPNG_LIBRARY="%PNG_LIBRARY%" ^
-DZLIB_INCLUDE_DIRS="%LIBRARY_INC%" ^
-DZLIB_LIBRARIES="%LIBRARY_BIN%\zlib.dll" ^
-DDLIB_JPEG_SUPPORT=1 ^
-DDLIB_USE_BLAS=0 ^
-DDLIB_USE_LAPACK=0 ^
-DUSE_SSE2_INSTRUCTIONS=1 ^
-DUSE_SSE4_INSTRUCTIONS=0 ^
-DUSE_AVX_INSTRUCTIONS=0 ^
-DDLIB_USE_CUDA=0 ^
-DDLIB_GIF_SUPPORT=0
if errorlevel 1 exit 1
cmake --build . --target INSTALL --config Release
if errorlevel 1 exit 1
rem Copy the dlib library to site packages
move "..\python_examples\dlib.pyd" "%SP_DIR%\dlib.pyd"
if errorlevel 1 exit 1
#!/bin/bash
set +x
rm -fr build
mkdir -p build
cd build
if [ $PY3K -eq 1 ]; then
export PY_STR="${PY_VER}m"
else
export PY_STR="${PY_VER}"
fi
# Make the probably sensible assumption that a 64-bit
# machine supports SSE4 instructions - if this becomes
# a problem we should turn this off.
if [ $ARCH -eq 64 ]; then
USE_SSE4=1
else
USE_SSE4=0
fi
PYTHON_LIBRARY_PATH="$PREFIX/lib/libpython$PY_STR$SHLIB_EXT"
cmake -LAH ../tools/python \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DCMAKE_BUILD_TYPE="Release" \
-DBoost_USE_STATIC_LIBS=0 \
-DBoost_USE_STATIC_RUNTIME=0 \
-DBOOST_ROOT="$PREFIX" \
-DBOOST_INCLUDEDIR="$PREFIX/include" \
-DBOOST_LIBRARYDIR="$PREFIX/lib" \
-DPYTHON_LIBRARY="$PYTHON_LIBRARY_PATH" \
-DPYTHON_INCLUDE_DIR="$PREFIX/include/python$PY_STR" \
-DPYTHON3=$PY3K \
-DDLIB_PNG_SUPPORT=1 \
-DPNG_INCLUDE_DIR="$PREFIX/include" \
-DPNG_PNG_INCLUDE_DIR="$PREFIX/include" \
-DPNG_LIBRARY="$PREFIX/lib/libpng$SHLIB_EXT" \
-DZLIB_INCLUDE_DIRS="$PREFIX/include" \
-DZLIB_LIBRARIES="$PREFIX/lib/libz$SHLIB_EXT" \
-DDLIB_JPEG_SUPPORT=1 \
-DJPEG_INCLUDE_DIR="$PREFIX/include" \
-DJPEG_LIBRARY="$PREFIX/lib/libjpeg$SHLIB_EXT" \
-DDLIB_LINK_WITH_SQLITE3=1 \
-DDLIB_NO_GUI_SUPPORT=1 \
-DUSE_SSE2_INSTRUCTIONS=1 \
-DUSE_SSE4_INSTRUCTIONS=$USE_SSE4 \
-DUSE_AVX_INSTRUCTIONS=0 \
-DDLIB_USE_BLAS=1 \
-DDLIB_USE_LAPACK=1 \
-DDLIB_USE_CUDA=0 \
-DDLIB_GIF_SUPPORT=0
make -j$CPU_COUNT
# Non-standard installation - copy manually
cp dlib.so $SP_DIR
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='image_metadata_stylesheet.xsl'?>
<dataset>
<name>Training faces</name>
<comment>See the FACE_LICENSE file for more information.</comment>
<images>
<image file='face.jpg'>
<box top='125' left='156' width='278' height='240'/>
</image>
<image file='face.png'>
<box top='125' left='156' width='278' height='240'/>
</image>
</images>
</dataset>
--- dlib/cmake_utils/cmake_find_blas.txt
+++ dlib/cmake_utils/cmake_find_blas.txt
@@ -156,15 +156,8 @@
set(blas_found 1)
message(STATUS "Found OpenBLAS library")
set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries})
- # If you compiled OpenBLAS with LAPACK in it then it should have the
- # sgetrf_single function in it. So if we find that function in
- # OpenBLAS then just use OpenBLAS's LAPACK.
- CHECK_FUNCTION_EXISTS(sgetrf_single OPENBLAS_HAS_LAPACK)
- if (OPENBLAS_HAS_LAPACK)
- message(STATUS "Using OpenBLAS's built in LAPACK")
- # set(lapack_libraries gfortran)
- set(lapack_found 1)
- endif()
+ message(STATUS "Using OpenBLAS's built in LAPACK")
+ set(lapack_found 1)
endif()
mark_as_advanced( cblas_lib)
endif()
{% set name = "dlib" %}
{% set version = "19.7" %}
package:
name: {{ name }}
version: {{ version }}
source:
url: https://github.com/davisking/{{ name }}/archive/v{{ version }}.tar.gz
sha1: 6dfc0dfa1cd45baa39a9b03238b222cd59041194
patches:
- osx_jpeg.patch # [osx]
- lapack_sgetrf.patch # [unix]
- win_boost.patch # [win]
- win_jpeg_png.patch # [win]
- win_release_flags.patch # [win]
- win_thread_fix.patch # [win]
build:
number: 3
skip: True # [blas_impl == 'mkl' and win]
requirements:
build:
- cmake
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- pkg-config
host:
- python
- numpy {{ numpy }}
- py-boost {{ boost }}
- libpng {{ libpng }}
- mkl-devel {{ mkl }} # [blas_impl == 'mkl']
- jpeg {{ jpeg }} # [not win]
- sqlite {{ sqlite }} # [not win]
run:
- python
- {{ pin_compatible('numpy') }}
- py-boost {{ boost }}
test:
files:
- face.jpg
- face.png
- images.xml
requires:
- tqdm
- pillow
imports:
- dlib
commands:
- conda inspect linkages -p $PREFIX {{ name }} # [not win]
- conda inspect objects -p $PREFIX {{ name }} # [osx]
about:
home: http://dlib.net/
license: Boost 1.0
license_file: dlib/LICENSE.txt
summary: Modern C++ toolkit containing machine learning algorithms with Python bindings
extra:
recipe-maintainers:
- tiago.pereira
- anjos
- amohammadi
--- dlib/CMakeLists.txt
+++ dlib/CMakeLists.txt
@@ -403,7 +403,7 @@
set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY})
CHECK_FUNCTION_EXISTS(jpeg_read_header LIBJPEG_IS_GOOD)
endif()
- if (JPEG_FOUND AND LIBJPEG_IS_GOOD AND NOT APPLE)
+ if (JPEG_FOUND AND LIBJPEG_IS_GOOD)
include_directories(${JPEG_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${JPEG_LIBRARY})
else()
import os
import sys
import bz2
import unittest
from functools import partial
import dlib
import numpy as np
from PIL import Image
from tqdm import tqdm
SHAPE_PREDICTOR_FNAME = 'shape_predictor_68_face_landmarks.dat'
SHAPE_PREDICTOR_BZ2_FNAME = SHAPE_PREDICTOR_FNAME + '.bz2'
SHAPE_PREDICTOR_URL = 'http://dlib.net/files/{}'.format(SHAPE_PREDICTOR_BZ2_FNAME)
def _download_file(url, out_path):
try:
from urllib import urlretrieve # Python 2
except ImportError:
from urllib.request import urlretrieve # Python 3
# Wrap tqdm instance with urlretrieve compatible function
# Abuse mutable [] argument to give function 'memory'
# First argument will be supplied using partial (an instance of tqdm)
def reporthook(t, b=1, bsize=1, tsize=None, last_b=[0]):
if tsize is not None:
t.total = tsize
t.update((b - last_b[0]) * bsize)
last_b[0] = b
with tqdm(unit='B', unit_scale=True, miniters=1, desc=out_path) as t:
urlretrieve(url, filename=out_path, reporthook=partial(reporthook, t))
def _bz2_decompress_inplace(path, out_path):
with open(path, 'rb') as source, open(out_path, 'wb') as dest:
dest.write(bz2.decompress(source.read()))
def _load_image_using_pillow(path):
return np.array(Image.open(path))
class TestDlib(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Get paths to test data
test_dir_path = os.path.dirname(os.path.abspath(__file__))
cls.face_jpg_path = os.path.join(test_dir_path, 'face.jpg')
cls.face_png_path = os.path.join(test_dir_path, 'face.png')
# Download shape_predictor model
print('Downloading {} to ./{}'.format(SHAPE_PREDICTOR_URL,
SHAPE_PREDICTOR_BZ2_FNAME))
_download_file(SHAPE_PREDICTOR_URL, SHAPE_PREDICTOR_BZ2_FNAME)
_bz2_decompress_inplace(SHAPE_PREDICTOR_BZ2_FNAME,
SHAPE_PREDICTOR_FNAME)
def test_builtin_frontal_face_detection(self):
detector = dlib.get_frontal_face_detector()
image = _load_image_using_pillow(self.face_jpg_path)
results = detector(image)
self.assertEqual(len(results), 1)
def test_shape_predictor(self):
predictor = dlib.shape_predictor(SHAPE_PREDICTOR_FNAME)
image = _load_image_using_pillow(self.face_jpg_path)
# This is the output of the detector, hardcoded
detection = dlib.rectangle(left=125, top=56, right=434, bottom=365)
shape = predictor(image, detection)
self.assertEqual(len(shape.parts()), 68)
for p in shape.parts():
self.assertGreater(p.x, 0)
self.assertGreater(p.y, 0)
def test_train_xml_detector(self):
# This effectively tests that we can successfully load images
options = dlib.simple_object_detector_training_options()
options.add_left_right_image_flips = True
options.C = 1
options.num_threads = 1
dlib.train_simple_object_detector('images.xml', "test.svm", options)