# Environments

The two environments of VisionPro Deep Learning are Training and Runtime. At the Training Phase your workshop will be the Training environment, and at the Deployment Phase, it will be the Runtime Environment. The topics below explain the major architectural differences between the runtime and training Training is the process that your tool, which is a neural network, is learning about the features (pixels) based on the labels you made. For example, a tool will learn the defect/normal pixels in each image based on the defect/normal labels you drew. The goal of the tool Training is learning enough to give the correct inspection results of whether an unseen image is defective or not. The key to training is to ensure that you include all possible variations within your training set, and that your images are accurately labeled. Training times vary by the application, tool setup and the GPU in the PC being used to train the network., their advantages and disadvantages, and the use-cases where one should be used over the other.

## Training Environment

Training Environment stands for both training and processing (or inference), which extends runtime functionality by also allowing users to configure, add, remove, and train tools through the Deep Learning DLL (API) or GUI.

### Training

The training in Training Environments stands for all the required steps to create, configure, and train each tool in VisionPro Deep Learning workspaces. The VisionPro Deep Learning tool in a workspace can be created, modified, configured, and trained to learn knowledge of the given images at this phase.

Pros | Cons
--- | ---
Can retrain | Harder to integrate Parameters are not frozen Version control is exposed to the user

Applications for training deployment are as follows:

- When the operators often need to adapt the tools, and importing and exporting is a difficult hurdle.
- When an integrator wants to use their own ecosystem to train, and not rely on another application.

Your vision application is responsible for the following:

- Reserves a hard drive folder to operate Deep Learning
- Exposes all the Deep Learning tool parameters to retrain the tools
- Handles the workspace versions
- Provides feedback to the user via a database summary

Programming Language | Methods | Examples | Notes
--- | --- | --- | ---
.NET | namespace Training | Example.Training.Console Example.Training.GUI | A .NET Wrapper provides UI elements that implements those tasks.
C | vidi_* vidi_training_* | Example.Cpp.Training.Blue Example.Cpp.Training.Red |

### Processing (Inference)

The processing in Training Environments stands for applying knowledge from each trained tool to infer results in VisionPro Deep Learning workspaces. The processing does not modify or train the tool. When a VisionPro Deep Learning tool in a workspace is under processing, it only infer results from images.

The Deep Learning DLL is responsible for the following:

- Manages the GPU
- Retrieves an image (through memory or hard drive) and returns an XML string

- Loads a workspace from a given folder or archive

Your vision application is responsible for the following:

- Reserves a hard drive folder to operate Deep Learning
- Acquires images
- Transmits the images to the VisionPro Deep Learning application
- Interprets the results and acts accordingly
- Provides feedback to the user

## Runtime Environment

Runtime stands for processing-only (inference-only), which means that the tools can process images, but the tools cannot be modified or retrained. The processing of tools is the minimum functionality required to be able to run the Deep Learning Tools in a deployed production environment.