Welcome to the PUBLIC git repo of the Videos & Images Theory and Analytics
Laboratory (VITAL) of Sherbrooke
University, headed by Professor Pierre-Marc Jodoin.
The purpose of this repository is threefold :
Keep a record of students projects, especially after they left the lab.
Provide reusable machine learning code.
Enforce a project architecture and coding standards, to promote consistency between projects and facilitate student collaboration.
Each project created by a member of the lab is located inside the project directory
with its own directory name like project/motorway, project/cifar and project/mio_tcd.
The model directory contains generic models organized by task like
model/classification/cnn.py. The dataset directory contains the code required to
load the data of any dataset used in our lab. Like the model directory, the dataset
directory is organized by task. The utils directory contains code that may be used by
Projects and datasets in the deprecated directory are no longer supported.
Everyone who wishes to contribute has to comply to both of these interfaces:
How to install it
Download the Miniconda installation script for python 3
Execute the downloaded file and follow the prompt instructions
Make sure you have this line in your
. <anaconda/miniconda installation path>/etc/profile.d/conda.sh
Restart your terminal and test your installation:
Create a Conda environment (Do this only once per environment):
conda create -n <EnvironmentName> python pip
conda info --envs to make sure your environment was correctly installed
Start your Conda environment (You will need to do this every time you want to execute some code):
conda activate <EnvironmentName>
Complete the environment setup by installing the dependencies required by
- Install the conda dependencies using the shell script:
- Install the pip dependencies running:
pip install -r pip-requirements.txt
Note that you might need to add additional packages for specific projects.
Deep learning libraries
Install what you need from the following:
conda install tensorflow-gpu # 'tensorflow' is also available (cpu only) pip install keras conda install pytorch torchvision ignite -c pytorch
You should be able to successfully import your library (don't forget to use your conda environment):
import tensorflow import keras import torch
Specific library versions
It is also possible to install a specific version of Cuda, Cudnn and/or Tensorflow using the following command with your desired versions.
conda install -c anaconda cudatoolkit==8.0 conda install -c anaconda cudnn==6.0 conda install -c anaconda tensorflow-gpu==1.4
Installation of the VITALab library
The installation of our library is straightforward. Open a terminal and do:
cd PATH_TO_YOUR_DEVELOPMENT_VITALAB_PROJECT git clone https://bitbucket.org/vitalab/vitalabai_public.git cd vitalabai_public python setup.py develop
These commands will clone the repository, and link this directory inside your python environment.
The "develop" parameter implies that every change inside the repository will be available inside the python environment.
Now that the package is installed, let's test it.
Let's create a python file
test.py or open a
ipython3 command line and copy this.
from VITALabAI.VITALabAiAbstract import VITALabAiAbstract
This should work.
YOU ARE NOW READY TO GO, ENJOY!
How to commit
In order to commit, your code must respect the Pep8 and documentation tests. To
automatically check your code, add the following
To install this hook:
- Download the file and copy it to
- Run this command
chmod +x pre-commit
The hook will run the tests locally every time you commit. You can also run the test
manually from the
pytest --pep8 -m pep8 -n0 <target_dir> pytest tests/
It is possible that the Pytest fails because of unknown arguments. In that case, it is possible that the
wrong version of Pytest is being used. In some cases, the Pytest version of the default Python is used
instead of the version installed in your Anaconda environment. To fix this, uninstall Pytest from your
When committing you must be in your Anaconda environment, if not the test will probably fail because of