Commit a7192a0d authored by Davis King's avatar Davis King

merged

parents 00b2c22c f50faa47
......@@ -17,7 +17,7 @@ namespace dlib
This object defines the interface a feature extractor must implement if it
is to be used with the process_sample and policy objects defined at the
bottom of this file. Moreover, it is meant to represent the core part
of a model use in a reinforcement learning algorithm.
of a model used in a reinforcement learning algorithm.
In particular, this object models a Q(state,action) function where
Q(state,action) == dot(w, PSI(state,action))
......
......@@ -3,7 +3,7 @@
#ifndef DLIB_FLOAT_DEtAILS_Hh_
#define DLIB_FLOAT_DEtAILS_Hh_
#include <math.h>
#include <cmath>
#include "algs.h"
#include <limits>
......@@ -100,24 +100,6 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
double _frexp(double v, int* e) const { return frexp(v,e); }
float _frexp(float v, int* e) const { return frexpf(v,e); }
double _ldexp(double v, int e) const { return ldexp(v,e); }
float _ldexp(float v, int e) const { return ldexpf(v,e); }
#ifdef __CYGWIN__
// frexpl and ldexpl aren't available on cygwin so just use the double version.
long double _frexp(long double v, int* e) const { return _frexp((double)v,e); }
long double _ldexp(long double v, int e) const { return _ldexp((double)v,e); }
#else
long double _frexp(long double v, int* e) const { return frexpl(v,e); }
long double _ldexp(long double v, int e) const { return ldexpl(v,e); }
#endif
template <typename T>
void convert_from_T (
const T& val
......@@ -138,7 +120,7 @@ namespace dlib
else if (val < std::numeric_limits<T>::infinity())
{
int exp;
mantissa = static_cast<int64>(_frexp(val, &exp)*(((uint64)1)<<digits));
mantissa = static_cast<int64>(std::frexp(val, &exp)*(((uint64)1)<<digits));
exponent = exp - digits;
// Compact the representation a bit by shifting off any low order bytes
......@@ -162,7 +144,7 @@ namespace dlib
) const
{
if (exponent < is_inf)
return _ldexp((T)mantissa, exponent);
return std::ldexp((T)mantissa, exponent);
else if (exponent == is_inf)
return std::numeric_limits<T>::infinity();
else if (exponent == is_ninf)
......
......@@ -20,7 +20,7 @@
// C with Fortran is on this platform/toolset
#if defined(__GNUC__) || defined(__ICC) || defined(__sgi) || defined(__COMO__) || defined(__KCC)
#define DLIB_BIND_FORTRAN_LOWERCASE_UNDERSCORE
#elif defined(__IBMCPP__) || defined(_MSC_VER)
#elif defined(__IBMCPP__) || defined(_MSC_VER) || defined(__BORLANDC__)
#define DLIB_BIND_FORTRAN_LOWERCASE
#else
#error do not know how to link with fortran for the given platform
......
......@@ -733,6 +733,14 @@ namespace dlib
from being parsed into a matrix then #in.fail() == true.
!*/
/*!A csv
This object is used to define an io manipulator for matrix expressions. In
particular, you can write statements like:
cout << csv << yourmatrix;
and have it print the matrix with commas separating each element.
!*/
some_undefined_iomnaip_type csv;
// ----------------------------------------------------------------------------------------
template <typename EXP>
......
......@@ -12,7 +12,7 @@
<body>
<h2>Compiling on Any Operating System Using CMake</h2>
<h2>Compiling C++ Example Programs on Any Operating System Using CMake</h2>
The best way to compile a program that uses dlib is to use <a href="http://www.cmake.org">CMake</a>. For
example, the following commands will compile the example programs on any operating
system:
......@@ -44,11 +44,23 @@ tell CMake which one you want it to use via the -G option.
<br/>
<br/>
<h2>Compiling Dlib's Python Interface</h2>
<p>
Go to the base folder of the dlib repository and run <tt>python setup.py install</tt>. That
should compile and install the dlib python API on your system.
</p>
<p>
Alternatively, if you want to add more python bindings to dlib's
python interface then you probably want to avoid the setup.py file
and work directly using CMake. In particular, dlib's python API is
built by the CMake project in the tools/python folder. You build
this project using the usual CMake commands and when compiled it
outputs the dlib shared library that defines the python API for dlib.
</p>
<br/>
<h2>Compiling Without CMake</h2>
<h2>Compiling C++ Examples Without CMake</h2>
<p>
In most cases, to use this library all you have to do is extract it somewhere, make
......@@ -137,13 +149,15 @@ sudo apt-get install libx11-dev
</p>
<center><h1>Preprocessor Directives</h1></center>
<br/>
<center><h1>Miscellaneous Preprocessor Directives</h1></center>
<p>
There are a few preprocessor directives you can supply during the build process
to cause the library to build in various optional ways. By default, the
library will always do something reasonable, but they are listed here in the
event that you need to use them.
In addition to the preprocessor directives mentioned above, there
are a few more you can supply during the build process to cause the
library to build in various optional ways. By default, the library
will always do something reasonable, but they are listed here in
the event that you need to use them.
</p>
......
......@@ -409,6 +409,10 @@
<item nolink="true">
<name>Other Utilities</name>
<sub>
<item>
<name>csv</name>
<link>dlib/matrix/matrix_abstract.h.html#csv</link>
</item>
<item>
<name>fft</name>
<link>dlib/matrix/matrix_fft_abstract.h.html#fft</link>
......
......@@ -11,6 +11,31 @@
<!-- ************************************************************************************** -->
<current>
New Features:
- Added the set_ptrm() routine for assigning dlib::matrix objects to arbitrary
memory blocks.
Non-Backwards Compatible Changes:
Bug fixes:
- Fixed a bug that caused cmake to not provide the correct preprocessor
definitions until cmake was run twice. This was causing some projects to
not build properly.
Other:
- Improvements to build system:
- Ehsan Azarnasab contributed a setup.py so the dlib Python API can be
installed via the usual 'python setup.py install' command.
- Séverin Lemaignan upgraded dlib's CMake scripts so they include an
install target. Now dlib can be installed system wide by executing
'cmake PATH_TO_DLIB; make install'. This also includes installing the
appropriate scripts for CMake's find_package(dlib) to work.
</current>
<!-- ************************************************************************************** -->
<old name="18.17" date="Aug 15, 2015">
New Features:
- More clustering tools:
- Added bottom_up_cluster() and find_clusters_using_angular_kmeans()
......@@ -45,7 +70,7 @@ Bug fixes:
Other:
</current>
</old>
<!-- ************************************************************************************** -->
......
......@@ -479,6 +479,7 @@
<term file="containers.html" name="map" include="dlib/map.h"/>
<term file="dlib/matrix/matrix_abstract.h.html" name="csv" include="dlib/matrix.h"/>
<term file="dlib/matrix/matrix_data_layout_abstract.h.html" name="row_major_layout" include="dlib/matrix.h"/>
<term file="dlib/matrix/matrix_data_layout_abstract.h.html" name="column_major_layout" include="dlib/matrix.h"/>
......
......@@ -69,7 +69,6 @@ tar -cf $SOURCE_TAR $RELDIR || report_failure
#find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs flip -m
find $RELDIR -name "*.cpp" -or -name "*.h" -or -name "*.txt" -or -name "*.html" -or -name "*.py" | xargs unix2dos &> /dev/null
scp davis@home.dlib.net:dlib_win_python/* $RELDIR/python_examples || report_failure
zip -r9 $SOURCE_ZIP $RELDIR > /dev/null || report_failure
tar -C ../docs -cf $WEBPAGE web || report_failure
bzip2 $SOURCE_TAR || report_failure
......
mkdir build
cd build
cmake ../../tools/python
cmake --build . --config Release --target install
cd ..
......@@ -14,18 +14,27 @@
# and someone is waving the camera around. The task is to track the position of
# the juice box as the camera moves around.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
#
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
import os
......
......@@ -20,18 +20,26 @@
# program.
#
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
import sys
......
......@@ -20,18 +20,26 @@
# You can get the shape_predictor_68_face_landmarks.dat file from:
# http://sourceforge.net/projects/dclib/files/dlib/v18.10/shape_predictor_68_face_landmarks.dat.bz2
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
import sys
......
......@@ -13,9 +13,27 @@
# a few thousand rectangles it is much faster than scanning all possible
# rectangles inside an image.
#
#
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
......
......@@ -5,14 +5,24 @@
# problem solver. It is an implementation of the famous Hungarian algorithm
# and is quite fast, operating in O(N^3) time.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
import dlib
# Let's imagine you need to assign N people to N jobs. Additionally, each
......
......@@ -10,14 +10,23 @@
# will be to learn to identify person names. Once we have our segmentation
# model we can use it to find names in new sentences, as we will show.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
import sys
import dlib
......
......@@ -13,14 +13,25 @@
# that you use this score to order the objects so that the most relevant objects
# come to the top of the ranked list.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
#
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
import dlib
......
......@@ -13,14 +13,25 @@
# interface. So consider using the C++ interface instead if you find that
# running it in python is slow.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
#
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
import dlib
......
......@@ -7,18 +7,27 @@
# window object detector first published by Dalal and Triggs in 2005 in the
# paper Histograms of Oriented Gradients for Human Detection.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
#
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
import os
......
......@@ -16,18 +16,26 @@
# prediction tasks. But here we demonstrate it only on a simple face
# landmarking task.
#
# COMPILING THE DLIB PYTHON INTERFACE
# Dlib comes with a compiled python interface for python 2.7 on MS Windows. If
# you are using another python version or operating system then you need to
# compile the dlib python interface before you can use this file. To do this,
# run compile_dlib_python_module.bat. This should work on any operating
# system so long as you have CMake and boost-python installed.
# On Ubuntu, this can be done easily by running the command:
# COMPILING/INSTALLING THE DLIB PYTHON INTERFACE
# You can install dlib using the command:
# pip install dlib
#
# Alternatively, if you want to compile dlib yourself then go into the dlib
# root folder and run:
# python setup.py install
# or
# python setup.py install --yes USE_AVX_INSTRUCTIONS
# if you have a CPU that supports AVX instructions, since this makes some
# things run faster.
#
# Compiling dlib should work on any operating system so long as you have
# CMake and boost-python installed. On Ubuntu, this can be done easily by
# running the command:
# sudo apt-get install libboost-python-dev cmake
#
# Also note that this example requires scikit-image which can be installed
# via the command:
# pip install -U scikit-image
# pip install scikit-image
# Or downloaded from http://scikit-image.org/download.html.
import os
......
......@@ -2,6 +2,10 @@
Copyright (C) 2015 Ehsan Azar (dashesy@linux.com)
License: Boost Software License See LICENSE.txt for the full license.
This file basically just uses CMake to compile the dlib python bindings project
located in the tools/python folder and then puts the outputs into standard
python packages.
To build the dlib:
python setup.py build
To build and install:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment