Getting started

What do I need to install to run a module in Python?

The idea behind EnvisionBox is that each module has the same type of workflow. This not only means that each module has its own data to demo with, but it also means that each module makes use of similar installation procedures. We mainly make use of Python, and we here provide some information about how to get started with our modules.

General workflow

Every module has a Github repository associated with it. That Github repository you can download locally to your computer by cloning it via git or downloading it from Github itself. Once downloaded each repository has a jupyter notebook (much like Rmarkdown) script in there which contains the script you will be working in, alongside guiding text that will help you understand each step. However, before running this script you will first need to install the relevant packages. These packages you need for the script to run are given in 'requirements.txt' (if there is anything else needed this would be mentioned in the script itself). Once you have installed the packages (see below for instructions) you can go ahead and open the script in jupyter notebook.

That's it. For each module at EnvisionBox you just make sure you have the packages installed that you need, and then you can run the demo code. Below here we have an overview how to get there. We also provide a instruction video here that runs through these steps if you find that easier.

Instruction video

Installing Anaconda

While there many ways to install Python on your machine, Anaconda is very user friendly. It also allows you to manage 'conda environments', which allow you to install dependencies just for a single project, which prevents any incompatibilities between packages you use between projects. Indeed, when working with Python you learn quite quickly that different versions of particular packages can break other packages as they are not compatible.

Windows: You could follow this tutorial to install Anaconda here. Once you have installed Anaconda, you have a new terminal program called 'Anaconda Prompt', which will recognize conda commands. We will refer to this later on.

OS: You could follow the installation instructions here. Once you have installed Anaconda, the generic OS terminal program will recognize conda commands. We will refer to this later on.

Installing Git

Windows: Install Git, instruction video here. Once installed, this allows us to easily download GitHub repositories using a git command in your (Anaconda) terminal.

OS: Install Git, instruction video here. Once installed, this allows us to easily download GitHub repositories using a git command in your (Anaconda) terminal.

Setting up a module step 1: Clone an EnvisionBox repo from GitHub

Assuming Anaconda and Git are set up, let's assume we want to take a look at the following module: Mediapipe tracking and masking module.

What we first need to do is download the contents of the GitHub associated with this module. We see that the GitHub link is: https://github.com/WimPouw/envisionBOX_modulesWP. We can then download the contents to your machine via git.

Now open a terminal (OS) or an Anaconda Prompt (Windows). And then navigate to a folder where you want to save your repository to: e.g., 'cd C:\Desktop\'. Now you have navigated your terminal to this place.

Download the repository like so:

git clone https://github.com/WimPouw/envisionBOX_modulesWP.git

Setting up a module step 2: Install dependencies

Once the repository is cloned, we need to install the packages. We first install a package installer called 'pip' via a conda command. So open a terminal and run:

conda install pip

Next, navigate to the folder of the module in your terminal, e.g., 'cd C:/Desktop/envisionBOX_modulesWP/Mediapipe_Optional_Masking/'.

Now install the requirements.txt that is in that folder by running:

pip install -r requirements.txt

When this is done, everything is ready to go. Start Jupyter Notebook in the terminal (which is navigated to the folder of the module), and we fire up Jupyter Notebook by running the following command:

jupyter notebook
For a quick overview of what even is Jupyter Notebook see: here.