aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/eye_tracking_context/configuration_and_execution.md
blob: f13c6a24df106daec662a428c48abff319c17ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Edit and execute context
========================

The [utils.contexts module](../../argaze.md/#argaze.utils.contexts) provides ready-made contexts like:

* [Tobii Pro Glasses 2](context_modules/tobii_pro_glasses_2.md) live stream and post processing contexts,
* [Pupil Labs](context_modules/pupil_labs.md) live stream context,
* [OpenCV](context_modules/opencv.md) window cursor position and movie processing,
* [Random](context_modules/random.md) gaze position generator.

## Edit JSON configuration

Here is a JSON configuration that loads a [Random.GazePositionGenerator](../../argaze.md/#argaze.utils.contexts.Random.GazePositionGenerator) context:

```json
{
    "argaze.utils.contexts.Random.GazePositionGenerator": {
        "name": "Random gaze position generator",
        "range": [1280, 720],
        "pipeline": {
            "argaze.ArFeatures.ArFrame": {
                "size": [1280, 720]
            }
        }
    }
}
```

Let's understand the meaning of each JSON entry.

### argaze.utils.contexts.Random.GazePositionGenerator

The class name of the object being loaded from the [utils.contexts module](../../argaze.md/#argaze.utils.contexts).

### *name*

The name of the [ArContext](../../argaze.md/#argaze.ArFeatures.ArContext). Basically useful for visualization purposes.

### *range*

The range of the gaze position being generated. This property is specific to the [Random.GazePositionGenerator](../../argaze.md/#argaze.utils.contexts.Random.GazePositionGenerator) class.

### *pipeline*

A minimal gaze processing pipeline that only draws last gaze position.

## Context execution

A context can be loaded from a JSON configuration file using the [*load* command](../utils/main_commands.md).

```shell
python -m argaze load CONFIGURATION
```

This command should open a GUI window with a random yellow dot inside.

![ArGaze load GUI](../../img/argaze_load_gui_random.png)

!!! note ""

	At this point, it is possible to load any ready-made context from [utils.contexts](../../argaze.md/#argaze.utils.contexts) module. 

	However, the incoming gaze positions are not processed and gaze mapping would not be available for head-mounted eye tracker context.

	Read the [gaze analysis pipeline section](../gaze_analysis_pipeline/introduction.md) to learn how to process gaze positions then, the [ArUco markers pipeline section](../aruco_marker_pipeline/introduction.md) to learn how to enable gaze mapping with an ArUco markers setup.