aboutsummaryrefslogtreecommitdiff
path: root/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-28 15:05:01 +0200
committerThéo de la Hogue2023-08-28 15:05:01 +0200
commitf93d3e2b011fe1c1de93d0094ca45584ddd49936 (patch)
treea627bdcf45da2a63caaf40d66a12668301acff63 /docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md
parenteb8915ec0750699695e4d70af4abef56f56fbe9f (diff)
downloadargaze-f93d3e2b011fe1c1de93d0094ca45584ddd49936.zip
argaze-f93d3e2b011fe1c1de93d0094ca45584ddd49936.tar.gz
argaze-f93d3e2b011fe1c1de93d0094ca45584ddd49936.tar.bz2
argaze-f93d3e2b011fe1c1de93d0094ca45584ddd49936.tar.xz
Improving gaze analysis pipeline documentation.
Diffstat (limited to 'docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md')
-rw-r--r--docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md45
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md
new file mode 100644
index 0000000..0b45368
--- /dev/null
+++ b/docs/user_guide/gaze_analysis_pipeline/advanced_topics/module_loading.md
@@ -0,0 +1,45 @@
+Loading modules from another package
+====================================
+
+It possible to load GazeMovementIdentifier, ScanPathAnalyzer or AOIScanPathAnalyzer modules from another [python package](https://docs.python.org/3/tutorial/modules.html#packages).
+
+To do so, simply prepend the package where to find the module into the JSON configuration file:
+
+```
+{
+ ...
+ "gaze_movement_identifier": {
+ "my_package.MyGazeMovementIdentifierAlgorithm": {
+ "specific_plugin_parameter": 0
+ }
+ },
+ ...
+ "scan_path_analyzers": {
+ "my_package.MyScanPathAnalyzerAlgorithm": {
+ "specific_plugin_parameter": 0
+ }
+ }
+ ...
+ "aoi_scan_path_analyzers": {
+ "my_package.MyAOIScanPathAnalyzerAlgorithm": {
+ "specific_plugin_parameter": 0
+ }
+ }
+}
+```
+
+Then, load your package from the python script where the ArFrame is created.
+
+```python
+from argaze import ArFeatures
+
+# Import your own package
+import my_package
+
+# Load ArFrame
+ar_frame = ArFeatures.ArFrame.from_json('./configuration.json')
+
+# Print ArFrame attributes
+for module, scan_path_analyzer in ar_frame.scan_path_analyzers.items():
+ print('scan path analyzer type:', type(scan_path_analyzer))
+```