Skip to content

Commit 15f0860

Browse files
committed
Merge branch 'master' of https://github.com/ESA-PhiLab/iris
2 parents 4a28da7 + 10ffd4e commit 15f0860

8 files changed

Lines changed: 23 additions & 14 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cd iris
2020
python setup.py install
2121
```
2222

23-
If you are altering the IRIS source code then you made find it easier to install like below, to avoid having to reinstall it every time a change is made
23+
If you are altering the IRIS source code then you may find it easier to install like below, to avoid having to reinstall it every time a change is made
2424
```
2525
pip install -e ./
2626
```
@@ -34,12 +34,14 @@ Once installed, you can run the demo version of IRIS
3434
iris demo
3535
```
3636

37-
Having run the demo, you can then create a personalised config file, based on _demo/cloud-segmentation.json_. With your own config file, you can then instantiate your own custom project. <a href="https://github.com/ESA-PhiLab/iris/blob/master/docs/config.m">Here is a guide</a> on how to write your own config file.
37+
Having run the demo, you can then create a personalised config file, based on _demo/cloud-segmentation.json_. With your own config file, you can then instantiate your own custom project. <a href="https://github.com/ESA-PhiLab/iris/blob/master/docs/config.md">Here is a guide</a> on how to write your own config file.
3838

3939
```
4040
iris label <your-config-file>
4141
```
4242

43+
It is recommended to use a keyboard and mouse with scrollwheel for IRIS. Currently, control via trackpad is limited and awkward.
44+
4345
### Docker
4446

4547
You can also use Docker to deploy IRIS. First, build an image (run from IRIS's root directory). Then, you can use docker run to launch IRIS. However, please note that port-forwarding is needed (here we use port 80 as an example for a typical http setup, but the port number can be set in your IRIS config file) and the directory to your project also needs to be given as a volume to docker.
@@ -49,5 +51,8 @@ docker build --tag iris .
4951
docker run -p 80:80 -v <dataset_path>:/dataset/ --rm -it iris label /dataset/cloud-segmentation.json
5052
```
5153

54+
### Run on Github Codespaces
55+
To run in a [Github codespace](https://docs.github.com/en/codespaces/overview) fork this repository, then in the Github UI select `Code/Codespaces/Open in codespace`. Run `pip install -e .` and then `iris demo`. You will see a popup that there is an app on port 5000, click the link to open a new window showing Iris 🎉
56+
5257

5358
**Visit the official iris Github page: https://github.com/ESA-PhiLab/iris**

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
- [ ] Add helper tips for each field on Preferences tab after ~1 second mouse hover
3333
- [ ] Add admin tab for data statistics visualisation over the whole dataset. E.g. class pie-chart, RF confusion matrix, input dimension importance, etc.
3434
- [ ] Add "iris export <options> PROJECT" command to save final versions of masks, and output some python-friendly (e.g. pandas) tables to look at dataset statistics
35-
35+
- [ ] Add automatic config checker to spot common logic errors. Currently many typos/errors in config do not lead to a good error message.
3636

3737
### Big future plans:
3838

iris/admin/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import timedelta
33

44
import flask
5+
import markupsafe
56
from sqlalchemy import func
67

78
from iris.user import requires_admin, requires_auth
@@ -44,7 +45,7 @@ def users():
4445
users_json = [user.to_json() for user in users]
4546

4647
html = flask.render_template('admin/users.html', users=users_json, order_by=order_by, ascending=ascending)
47-
return flask.render_template('admin/index.html', user=user, page=flask.Markup(html))
48+
return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html))
4849

4950
@admin_app.route('/actions/<type>', methods=['GET'])
5051
@requires_auth
@@ -74,7 +75,7 @@ def actions(type):
7475
'admin/actions.html', action_type=type, actions=actions_json,
7576
image_stats=image_stats, order_by=order_by, ascending=ascending
7677
)
77-
return flask.render_template('admin/index.html', user=user, page=flask.Markup(html))
78+
return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html))
7879

7980
@admin_app.route('/images', methods=['GET'])
8081
@requires_auth
@@ -117,4 +118,4 @@ def images():
117118
html = flask.render_template(
118119
'admin/images.html', images=images, order_by=order_by, ascending=ascending
119120
)
120-
return flask.render_template('admin/index.html', user=user, page=flask.Markup(html))
121+
return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html))

iris/main/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33

44
import flask
5+
import markupsafe
56
import numpy as np
67
from PIL import Image as PILImage
78
from skimage.transform import resize
@@ -92,7 +93,7 @@ def metadata(image_id):
9293

9394
if flask.request.args.get('safe_html', False):
9495
metadata = {
95-
k: flask.Markup(str(v))
96+
k: markupsafe.Markup(str(v))
9697
for k, v in metadata.items()
9798
}
9899

iris/project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import re
1111

1212
import flask
13+
import markupsafe
14+
1315
import json
1416
from matplotlib import cm
1517
import numpy as np
@@ -95,7 +97,7 @@ def load_from(self, filename):
9597
# Make sure the HTML is understood in the descriptions:
9698
for name, view in self.config['views'].items():
9799
view['name'] = name
98-
view['description'] = flask.Markup(
100+
view['description'] = markupsafe.Markup(
99101
view.get('description', view['name'])
100102
)
101103
view['stretch'] = view.get('stretch', 'linear')

iris/segmentation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def save_mask(image_id):
272272
# The user mask denotes who classified the pixels in the mask:
273273
# if true: the user classified the pixel
274274
# if false: the AI classified the pixel
275-
user_mask = data[1+mask_length:-1].astype(np.bool)
275+
user_mask = data[1+mask_length:-1].astype(bool)
276276
user_mask = user_mask.reshape(project['segmentation']['mask_shape'][::-1])
277277

278278
final_mask_file, user_mask_file = get_mask_filenames(image_id, user_id)

iris/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from copy import deepcopy
22

33
import flask
4-
4+
import markupsafe
55

66

77
class View:
@@ -12,8 +12,8 @@ def __init__(self, name, description, loader):
1212

1313
def to_json(self):
1414
return {
15-
'name': flask.Markup(self.name),
16-
'description': flask.Markup(self.description),
15+
'name': markupsafe.Markup(self.name),
16+
'description': markupsafe.Markup(self.description),
1717
}
1818

1919
def merge_deep_dicts(d1, d2):

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
flask==2.2.2
1+
flask==2.3.2
22
flask_compress==1.13
33
flask-sqlalchemy==2.5.1
44
numpy==1.23.4
5-
pyyaml==5.4.1
5+
pyyaml>=5.4.1
66
lightgbm==3.3.3
77
rasterio==1.3.3
88
requests==2.28.1

0 commit comments

Comments
 (0)