Second Advanced Numerical Methods Project
These instructions will install the development environment into your local machine.
-
Clone the repository
$ git clone https://github.com/juanmbellini/heart_rate.git
-
Install Python and pip
A. Install packages
$ brew install python
B. Update the
PATH
variable to use the Homebrew's python packages$ echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH" # Use Homebrew python' >> ~/.bash_profile $ source ~/.bash_profile
$ sudo apt-get install python python-pip
-
Install Virtualenv and virtualenvwrapper
$ pip install virtualenv virtualenvwrapper $ echo 'source /usr/local/bin/virtualenvwrapper.sh # Virtualenv/VirtualenvWrapper' >> ~/.bash_profile $ source ~/.bash_profile
-
Create a virtual environment for the project
$ mkvirtualenv heart_rate
Note: This will install
setuptools
,pip
andwheel
modules in the new virtual environment.
-
Move to the new virtual environment and change working directory to project's root
$ workon heart_rate
Note: To leave the virtual environment, execute
$ deactivate
-
Install dependencies
$ pip install -r requirements.txt
-
Install module
$ python setup.py clean --all install
The application can be run executing the heart_rate
command.
The following sections will explain the different options and arguments that can be used.
You can display the usage message using the -h
or --help
arguments. For example:
$ heart_rate --help
You can check the version of the module using the -V
or --version
arguments. For example:
$ heart_rate -V
There are three levels of logging verbosity:
- Normal
- Verbose
- Very Verbose.
Normal verbosity logging will log WARNING, ERROR and CRITICAL messages. Verbose logging will log what Normal logging logs, and INFO messages. Very Verbose logging is the same as Verbose logging, adding DEBUG messages.
To use Normal verbosity logging just execute the command. Normal verbosity logging is the default
To use Verbose logging, add the -v
or --verbose
arguments. For example:
$ heart_rate --verbose
To use Very Verbose logging, add the -vv
or --very-verbose
arguments. For example:
$ heart_rate -vv
To set the video's path to analize, use the -vp
or --video_path
arguments. For example:
$ heart_rate -vp ~/video.mp4
The default value is the directory ./video
.
The rectangular region of interest consist of four limits. Each one specified by a parameter. This parameters are required and
must be consistent, else the program will no work
To set the upper limit, use the -rUL
or --roi-upper-limit
argument. For example:
$ heart_rate -rUL 200
To set the lower limit, use the -rLL
or --roi-lower-limit
argument. For example:
$ heart_rate -rLL 250
To set the right limit, use the -rrL
or --roi-right-limit
argument. For example:
$ heart_rate -rrL 100
To set the left limit, use the -rlL
or --roi-left-limit
argument. For example:
$ heart_rate -rlL 150
To set the bandpass maximum frequency, use the -MF
or --max-freq
arguments. For example:
$ heart_rate --MF 7.0
The default value is 7.0
.
To set the bandpass minimum frequency, use the -mF
or --min-freq
arguments. For example:
$ heart_rate --mF 0.4
The default value is 0.4
.
To set BLUE channel, use the -B
or --blue
arguments. For example:
$ heart_rate -B
To set RED channel, use the -R
or --red
arguments. For example:
$ heart_rate -R
To set GREEN channel, use the -G
or --green
arguments. For example:
$ heart_rate -G
The default channel is GREEN.
Here is a full example usign all arguments:
$ heart_rate -rUL 600 -rLL 630 -rlL 300 -rrL 360 -mF 2.2 -MF 4.0 -G -vp videos/1_seg_120ppm.MOV