Codes for Demo version of the HILC project
A visual-based interactive GUI Programming by Demonstration system.
-
The user demonstrates a desktop task. (see
genLog.py
) -
The system asks the user to clearify some confusing parts, if any. (see
gen_script_detectors.py
) -
The system generates runable script which can automatically perform the demonstrated task. (see
script_execution.py
)
Now HILC only works on Windows environment. Tested with Windows7 and Windows10.
##Dependencies
-
Python2.7
-
pyHook-1.5.1
andpygame-1.9.20
. Both dependencies can be downloaded thewheel
files here and usepip
to install by runningpip install WHEEL_FILE_NAME
. -
pyautogui
for mice and keyboards controlling. the package can be installed by runningpip install pyautogui
-
python packages (normally come with Python Anaconda Installation)
win32con,win32api,win32ui,win32gui,matplotlib
-
scikit-learn version < 0.18. If your machine has version >= 0.18 and is using
Anaconda
, the package can be downgraded by runningconda install scikit-learn=0.17.1
. -
Download pre-trained models (.pickle files) and pairwise potential (.csv file) from here.
##Basic Usage
Run the Windows PowerShell script .\run_all.ps1 PATH\TO\SAVE\FOLDER\
to run all steps.
###OR
Run each step as follows,
-
[Demonstration phase] run
python genLog.py --p=PATH\TO\SAVE\FOLDER\
to record user demonstration. -
[Demonstration phase] demonstrate a task.
- Linear Task : The demonstration procedure for the looping task is simply just a demonstration,
Demonstration.
- Looping Task : for looping tasks users need to input the Looping signals (Ctrl+Shift+L) or (Ctrl+Shift+Break). The demonstration procedure for the looping task is as follows,
Looping Signal > Demonstration > Looping Signal > Ctrl+Click on positive instances, providing examples of target patterns > Looping Signal.
- monitoring Task : for monitoring tasks users need to input the Standby Signals (Ctrl+Shift+W) or (Ctrl+Shift+PrtScr). The demonstration procedure for the monitoring task is as follows,
When the visual cue appears > Standby Signal > Demonstration.
-
[Demonstration phase] when the task demonstration is done, press
Shift + Esc
to end the sniffing script. -
[Demonstration phase] run
python preprocessing_sniffer_log.py --p=PATH\TO\SAVE\FOLDER\
to transform the generated log file to our unified input format (each consecitive records have time different 1/30s). -
[Demonstration phase] run
python transcribe_basicaction.py --p=PATH\TO\SAVE\FOLDER\
to transcibe the log-file to a sequence of basic actions.
This script needs to load pre-trained model and pairwise potential files to do basic action classification. The pre-trained models and pairwise potential can be downloaded from here. -
[Teaching phase] run
python gen_script_detectors.py --p=PATH\TO\SAVE\FOLDER\ --c=True
the script will train a detector for each basic action. After the detector is trained, the script will test the detector and ask for clarification if needed. In this step, the script needs to load the pre-scripted the questions filepygame_question_genscript.txt
, which can be downloaded from here. -
[Running phase] run
python script_execution.py --p=PATH\TO\SAVE\FOLDER\
to run the generated script.
If you use codes in this Repo, please cite our paper, Bibtex entry:
@inproceedings{IntharahHILC2017,
author = {Intharah, Thanapong and Turmukhambetov, Daniyar and Brostow, Gabriel J.},
title = {Help, It Looks Confusing: GUI Task Automation Through Demonstration and Follow-up Questions},
booktitle = {Proceedings of the 22nd International Conference on Intelligent User Interfaces},
series = {IUI '17},
year = {2017},
location = {Limassol, Cyprus},
publisher = {ACM},
}