Skip to content

Commit b612391

Browse files
author
mplaine
committed
Initial commit
1 parent 29f9160 commit b612391

File tree

192 files changed

+25096
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+25096
-2
lines changed

.gitignore

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
2+
# Created by https://www.gitignore.io/api/c,node,python
3+
4+
### C ###
5+
# Prerequisites
6+
*.d
7+
8+
# Object files
9+
*.o
10+
*.ko
11+
*.obj
12+
*.elf
13+
14+
# Linker output
15+
*.ilk
16+
*.map
17+
*.exp
18+
19+
# Precompiled Headers
20+
*.gch
21+
*.pch
22+
23+
# Libraries
24+
*.lib
25+
*.a
26+
*.la
27+
*.lo
28+
29+
# Shared objects (inc. Windows DLLs)
30+
# *.dll
31+
# *.so
32+
# *.so.*
33+
# *.dylib
34+
35+
# Executables
36+
*.exe
37+
*.out
38+
# *.app
39+
*.i*86
40+
*.x86_64
41+
*.hex
42+
43+
# Debug files
44+
*.dSYM/
45+
*.su
46+
*.idb
47+
*.pdb
48+
49+
# Kernel Module Compile Results
50+
*.mod*
51+
*.cmd
52+
.tmp_versions/
53+
modules.order
54+
Module.symvers
55+
Mkfile.old
56+
dkms.conf
57+
58+
### Node ###
59+
# Logs
60+
logs
61+
*.log
62+
npm-debug.log*
63+
yarn-debug.log*
64+
yarn-error.log*
65+
66+
# Runtime data
67+
pids
68+
*.pid
69+
*.seed
70+
*.pid.lock
71+
72+
# Directory for instrumented libs generated by jscoverage/JSCover
73+
lib-cov
74+
75+
# Coverage directory used by tools like istanbul
76+
coverage
77+
78+
# nyc test coverage
79+
.nyc_output
80+
81+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
82+
.grunt
83+
84+
# Bower dependency directory (https://bower.io/)
85+
bower_components
86+
87+
# node-waf configuration
88+
.lock-wscript
89+
90+
# Compiled binary addons (http://nodejs.org/api/addons.html)
91+
build/Release
92+
93+
# Dependency directories
94+
node_modules/
95+
jspm_packages/
96+
97+
# Typescript v1 declaration files
98+
typings/
99+
100+
# Optional npm cache directory
101+
.npm
102+
103+
# Optional eslint cache
104+
.eslintcache
105+
106+
# Optional REPL history
107+
.node_repl_history
108+
109+
# Output of 'npm pack'
110+
*.tgz
111+
112+
# Yarn Integrity file
113+
.yarn-integrity
114+
115+
# dotenv environment variables file
116+
.env
117+
118+
119+
### Python ###
120+
# Byte-compiled / optimized / DLL files
121+
__pycache__/
122+
*.py[cod]
123+
*$py.class
124+
125+
# C extensions
126+
127+
# Distribution / packaging
128+
.Python
129+
develop-eggs/
130+
dist/
131+
downloads/
132+
eggs/
133+
.eggs/
134+
# lib/
135+
lib64/
136+
parts/
137+
sdist/
138+
var/
139+
wheels/
140+
*.egg-info/
141+
.installed.cfg
142+
*.egg
143+
144+
# Application-specific files
145+
aim_backend/configs/*.json
146+
aim_backend/data/results/*.png
147+
aim_backend/data/screenshots/*.png
148+
aim_backend/inputs/*.txt
149+
aim_backend/screenshots/*.png
150+
151+
# PyInstaller
152+
# Usually these files are written by a python script from a template
153+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
154+
*.manifest
155+
*.spec
156+
157+
# Installer logs
158+
pip-log.txt
159+
pip-delete-this-directory.txt
160+
161+
# Unit test / coverage reports
162+
htmlcov/
163+
.tox/
164+
.coverage
165+
.coverage.*
166+
.cache
167+
.pytest_cache/
168+
nosetests.xml
169+
coverage.xml
170+
*.cover
171+
.hypothesis/
172+
173+
# Translations
174+
*.mo
175+
*.pot
176+
177+
# Flask stuff:
178+
instance/
179+
.webassets-cache
180+
181+
# Scrapy stuff:
182+
.scrapy
183+
184+
# Sphinx documentation
185+
docs/_build/
186+
187+
# PyBuilder
188+
target/
189+
190+
# Jupyter Notebook
191+
.ipynb_checkpoints
192+
193+
# pyenv
194+
.python-version
195+
196+
# celery beat schedule file
197+
celerybeat-schedule.*
198+
199+
# SageMath parsed files
200+
*.sage.py
201+
202+
# Environments
203+
.venv
204+
env/
205+
venv/
206+
ENV/
207+
env.bak/
208+
venv.bak/
209+
210+
# Spyder project settings
211+
.spyderproject
212+
.spyproject
213+
214+
# Rope project settings
215+
.ropeproject
216+
217+
# mkdocs documentation
218+
/site
219+
220+
# mypy
221+
.mypy_cache/
222+
223+
224+
# End of https://www.gitignore.io/api/c,node,python
225+
226+
# Mac OS
227+
.DS_Store
228+
229+
# IDEs
230+
.idea/

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# AIM Contributing Guide
2+
3+
We are really excited that you are interested in contributing to AIM! Before submitting your contribution though, please make sure to take a moment and read through the following instructions and guidelines.
4+
5+
6+
## Extending AIM with New Metrics
7+
8+
AIM has been designed from the ground-up with extensibility in mind. As a result, new metrics can be added with relatively small effort, but there are a few steps that need to be followed.
9+
10+
First, the new metric should be defined in a separate Python file and placed under a proper subdirectory within the [aim_metrics](./aim_metrics/aim_metrics/) directory. The entry point to the metric must be a function called `execute`, and it must take as a parameter a base64 encoded image (PNG or JPG) representation of the web page. Segmentation-based metrics must take as an additional parameter to this a list of page elements, generated by the segmentation script. The `execute` function must return a list of results, which must have at least one entry. The result entries must be *int*, *float*, or a *base64* encoded image representation of the web page.Metrics are executed on the backend by the [metric_executor.py](./aim_backend/uimetrics_backend/metric_executor.py) file. The metric must be imported here, and it must to be registered to the list of executable metrics. Each list entry has the metric ID as key and a dictionary of options as value. The dictionary specifies the type of the metric (`png` for pixel-based, `jpg` for pixel-based, or `seg` for segmentation-based) and the imported metric module itself.In addition to the backend, the metric must be registered on the frontend too to show up on the list of metrics. This is done in the [metrics.js](./aim_frontend/src/config/metrics.js) file. Here, a new entry must be added in the JSON under the `metrics` key. Each entry’s key is its metric ID.  **Table 1.** Description of `metrics` entry in `metrics.js`
11+
| Key | Description |
12+
|:------------------|:------------|
13+
| id | Metric ID |
14+
| name | Metric name. Will be displayed in list of metrics on the frontend |
15+
| category | Metric category ID |
16+
| description | Description of the metric |
17+
| evidence | 1-5 `int`; rating of evidence for this metric || relevance | 1-5 `int`; rating of relevance for this metric |
18+
| speed | 0-2 `int`; 0=slow, 1=medium, 2=fast, will be displayed as ‘Computation time’ |
19+
| visualizationType | `table` or `b64`, table=numerical results, b64=image results || references | List of `references` entries specifying references, cf. description below || results | List of `results` entries specifying results, cf. description below |  **Table 2.** Description of `references` entry in `metrics.js`
20+
21+
| Key | Description |
22+
|:---------|:------------|| title | Reference title, will be shown in a tooltip when hovering over the reference number || fileName | Name of the PDF file of the reference paper |
23+
24+
  **Table 3.** Description of `results` entry in `metrics.js`
25+
| Key | Description ||:------------|:------------|
26+
| id | Result ID, format is metric ID + underscore + index in the array returned by the metric || index | Index in metric result array || type | `int`, `float`, or `b64` || name | Result name || description | Optional description of the result. `false` if there is no description |Every metric also must be added under a proper `category` at the start of the same file. A new category can also be created.
27+
28+
  **Table 4.** Description of `categories` entry in `metrics.js`
29+
30+
| Key | Description |
31+
|:--------|:------------|| name | Category name || id | Category ID || color | Name of the CSS class in `AIMForm.vue` specifying the category color || metrics | List of metric IDs belonging to this category |
32+
After adding a new metric, the frontend must be restarted with `npm run dev` for development or recompiled with `npm run build` for production (executed in the [aim_frontend](./aim_frontend/) directory). For the backend, the AIM metrics package must be reinstalled with `pip install ../aim_metrics` and the server must be relaunched with `python uimetrics_backend/main.py` (executed in the [aim_backend](./aim_backend/) directory).

LICENSE.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MIT License
2+
3+
4+
Copyright © 2018 User Interfaces group, Aalto University, Finland
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,101 @@
1-
# aim
2-
Code repository for the Aalto Interface Metrics (AIM) service. https://interfacemetrics.aalto.fi/
1+
![interfacemetrics.aalto.fi](./aim_frontend/src/assets/workflow.png)
2+
3+
# AIM – Aalto Interface Metrics
4+
5+
AIM is an online service and an open code repository for *computational evaluation* of graphical user interface (GUI) designs. AIM pools several previously published metrics and models, which have been empirically shown to be predictive of how users perceive, search, and aesthetically experience a design. These metrics range from design heuristics like symmetry to metrics and full-fledged models, such as saliency and visual clutter.
6+
7+
More information on AIM can be found in the [paper](./aim_frontend/static/publications/oulasvirta_et_al_2018.pdf) published in [UIST'18](http://uist.acm.org/uist2018/).
8+
9+
10+
## Architecture and Technologies
11+
12+
AIM's codebase is divided into four distinct parts:
13+
14+
* [Frontend - web application](./aim_frontend/)
15+
* [Backend - web application](./aim_backend/)
16+
* [Metrics library](./aim_metrics/)
17+
* [Segmentation script](./aim_segmentation/)
18+
19+
The web application's frontend is built with [Vue.js](https://vuejs.org/), whereas the backend is based on [Tornado](http://www.tornadoweb.org/). The frontend and the backend communicate with each other via [WebSocket](https://tools.ietf.org/html/rfc6455).
20+
21+
### Depencencies
22+
23+
The metrics library and the segmentation script are both dependencies for the web application's backend. Other dependencies include [Node.js](https://nodejs.org/) + [npm](https://www.npmjs.com/) (frontend), [Python 2.7](https://www.python.org/) + [pip](https://pypi.org/project/pip/) (backend), and [MongoDB](https://www.mongodb.com/) (database). In addition, the backend depends on [Headless Chrome](https://www.google.com/chrome/) and [layout-learning](./aim_backend/bin/layout-learning). The former is used to capture web page screenshots and the latter offers an implementation for the visual search performance metric (needs to be compiled under the target platform, only Linux is available for now).
24+
25+
26+
## Installation
27+
28+
### Frontend
29+
30+
Start by configuring frontend environment variables for [development](./aim_frontend/config/dev.env.js), [test](./aim_frontend/config/test.env.js), and [production](./aim_frontend/config/prod.env.js). Then, go to the [aim_frontend](./aim_frontend/) directory and run the following command:
31+
32+
```bash
33+
# Install required packages
34+
npm install
35+
```
36+
37+
### Backend
38+
39+
Configure backend environment variables for [development](./aim_backend/configs/development.conf), [test](./aim_backend/configs/test.conf), and [production](./aim_backend/configs/productions.conf). Next, go to the [aim_backend](./aim_backend/) directory, and create and activate a new Python virtual environment (if needed). Run the following commands:
40+
41+
```bash
42+
# Install required packages
43+
pip install ../aim_metricspip install ../aim_segmentation
44+
pip install -r requirements.txtpip install opencv-python
45+
```
46+
47+
### Database
48+
49+
Create `aim` database in MongoDB with the following two collections under it: `screenshots` and `results`.
50+
51+
52+
## Usage
53+
54+
### Frontend
55+
56+
Go to the [aim_frontend](./aim_frontend/) directory first, and then run the following command:
57+
58+
```bash
59+
# Serve with hot reload at localhost:8080
60+
npm run dev
61+
```
62+
To build the frontend for production:
63+
64+
```bash
65+
# Build for production with minification
66+
npm run build
67+
```
68+
69+
After the build is complete, the files (for production) can be found under the *dist* directory. These files are meant to be served over an HTTP server, such as [Apache HTTP Server](https://httpd.apache.org/).
70+
71+
### Backend
72+
73+
To run the backend server, go the [aim_backend](./aim_backend/) directory and execute:
74+
75+
```bash
76+
# Start the serverpython uimetrics_backend/main.py
77+
```
78+
79+
It is highly recommended to use a load balancer in a production environment, as certain metrics are extremely CPU intensive. This means that the backend needs to be launched with multiple instances, each listening to a different port. A process manager (e.g., [pm2](http://pm2.keymetrics.io/)) will come in handy at that point. Also, define the AIM_ENV environment variable on the production server and set its value to "production" (defaults to "development").
80+
81+
82+
## Contributing
83+
84+
Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on contributing to AIM.
85+
86+
87+
## Changelog
88+
89+
Detailed changes for each release are documented in the [release notes](https://github.com/aalto-ui/aim/releases).
90+
91+
92+
## Contact
93+
94+
For questions and further information, please contact us via email at <interfacemetrics@aalto.fi>.
95+
96+
97+
## License
98+
99+
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT), see the [LICENSE.txt](./LICENSE.txt) file for details.
100+
101+
Copyright © 2018 [User Interfaces group](https://userinterfaces.aalto.fi/), [Aalto University](https://www.aalto.fi/), Finland

aim_backend/bin/layout-learning

61.7 MB
Binary file not shown.

aim_backend/configs/.gitkeep

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
port=8888
2+
name="aim-dev"
3+
chrome_path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
4+
layout_learning_path="bin/layout-learning"
5+
database_uri="mongodb://<USERNAME>:<PASSWORD>@localhost:27017/aim"
6+
results_data_dir="data/results"
7+
screenshots_data_dir="data/screenshots"

0 commit comments

Comments
 (0)