From 3993fbe95fcc67588ecde8b5f3eb1e3d1e9d8936 Mon Sep 17 00:00:00 2001 From: aliFrancis Date: Wed, 22 Feb 2023 11:55:42 +0100 Subject: [PATCH 1/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5619cb9..8c9b812 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Once installed, you can run the demo version of IRIS iris demo ``` -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. Here is a guide on how to write your own config file. +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. Here is a guide on how to write your own config file. ``` iris label From 4b791a73ae6fbf9e785f756913e02283b02a8ca9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 May 2023 00:16:12 +0000 Subject: [PATCH 2/8] Bump flask from 2.2.2 to 2.3.2 Bumps [flask](https://github.com/pallets/flask) from 2.2.2 to 2.3.2. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.2.2...2.3.2) --- updated-dependencies: - dependency-name: flask dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fd5adb7..67cdee2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -flask==2.2.2 +flask==2.3.2 flask_compress==1.13 flask-sqlalchemy==2.5.1 numpy==1.23.4 From 36a6d7c23bfd51a191472d08e6a1b1b915f015dd Mon Sep 17 00:00:00 2001 From: aliFrancis Date: Thu, 10 Aug 2023 09:53:45 +0200 Subject: [PATCH 3/8] Update TODO.md See #34 for example of problem --- TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 1c65da9..8a48735 100644 --- a/TODO.md +++ b/TODO.md @@ -32,7 +32,7 @@ - [ ] Add helper tips for each field on Preferences tab after ~1 second mouse hover - [ ] Add admin tab for data statistics visualisation over the whole dataset. E.g. class pie-chart, RF confusion matrix, input dimension importance, etc. - [ ] Add "iris export PROJECT" command to save final versions of masks, and output some python-friendly (e.g. pandas) tables to look at dataset statistics - +- [ ] Add automatic config checker to spot common logic errors. Currently many typos/errors in config do not lead to a good error message. ### Big future plans: From b5e07329ecf8d91b3eb4b3d4f05bf5229f657557 Mon Sep 17 00:00:00 2001 From: aliFrancis Date: Tue, 26 Sep 2023 16:51:20 +0200 Subject: [PATCH 4/8] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8c9b812..fde7d5b 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ Having run the demo, you can then create a personalised config file, based on _d iris label ``` +It is recommended to use a keyboard and mouse with scrollwheel for IRIS. Currently, control via trackpad is limited and awkward. + ### Docker 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. From b14c58436db1b42bf488cc5d0a836f2e1b9fe947 Mon Sep 17 00:00:00 2001 From: Robin Cole Date: Mon, 9 Oct 2023 12:07:39 +0000 Subject: [PATCH 5/8] Document codespaces --- README.md | 3 +++ requirements.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c9b812..922d5f3 100644 --- a/README.md +++ b/README.md @@ -49,5 +49,8 @@ docker build --tag iris . docker run -p 80:80 -v :/dataset/ --rm -it iris label /dataset/cloud-segmentation.json ``` +### Run on Github Codespaces +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 🎉 + **Visit the official iris Github page: https://github.com/ESA-PhiLab/iris** diff --git a/requirements.txt b/requirements.txt index 67cdee2..8ea4af3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ flask==2.3.2 flask_compress==1.13 flask-sqlalchemy==2.5.1 numpy==1.23.4 -pyyaml==5.4.1 +pyyaml>=5.4.1 lightgbm==3.3.3 rasterio==1.3.3 requests==2.28.1 From 40cf00d0e89aabd8542aee36a145f56b2d623ae8 Mon Sep 17 00:00:00 2001 From: James Wheeler Date: Thu, 7 Dec 2023 15:17:01 +0100 Subject: [PATCH 6/8] Update README.md Typo fixed made->may --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d0e625..0703388 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ cd iris python setup.py install ``` -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 +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 ``` pip install -e ./ ``` From 05e15529d09901450843e457b9cbd1526516f1e6 Mon Sep 17 00:00:00 2001 From: Leo Breebaart Date: Tue, 9 Jul 2024 11:54:57 +0200 Subject: [PATCH 7/8] Replaced 'np.bool' (deprecated: 1.20, removed: 1.24) with 'bool' --- iris/segmentation/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iris/segmentation/__init__.py b/iris/segmentation/__init__.py index 0b49434..3e61039 100644 --- a/iris/segmentation/__init__.py +++ b/iris/segmentation/__init__.py @@ -272,7 +272,7 @@ def save_mask(image_id): # The user mask denotes who classified the pixels in the mask: # if true: the user classified the pixel # if false: the AI classified the pixel - user_mask = data[1+mask_length:-1].astype(np.bool) + user_mask = data[1+mask_length:-1].astype(bool) user_mask = user_mask.reshape(project['segmentation']['mask_shape'][::-1]) final_mask_file, user_mask_file = get_mask_filenames(image_id, user_id) From 8b2cc58ea6a928a4fb66d84bf113a9dbd3ef6a2e Mon Sep 17 00:00:00 2001 From: Leo Breebaart Date: Tue, 9 Jul 2024 12:04:17 +0200 Subject: [PATCH 8/8] Replaced flask.Markup (deprecated upstream) with markupsafe.Markup --- iris/admin/__init__.py | 7 ++++--- iris/main/__init__.py | 3 ++- iris/project.py | 4 +++- iris/utils.py | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/iris/admin/__init__.py b/iris/admin/__init__.py index a5e81cf..1fb73fd 100644 --- a/iris/admin/__init__.py +++ b/iris/admin/__init__.py @@ -2,6 +2,7 @@ from datetime import timedelta import flask +import markupsafe from sqlalchemy import func from iris.user import requires_admin, requires_auth @@ -44,7 +45,7 @@ def users(): users_json = [user.to_json() for user in users] html = flask.render_template('admin/users.html', users=users_json, order_by=order_by, ascending=ascending) - return flask.render_template('admin/index.html', user=user, page=flask.Markup(html)) + return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html)) @admin_app.route('/actions/', methods=['GET']) @requires_auth @@ -74,7 +75,7 @@ def actions(type): 'admin/actions.html', action_type=type, actions=actions_json, image_stats=image_stats, order_by=order_by, ascending=ascending ) - return flask.render_template('admin/index.html', user=user, page=flask.Markup(html)) + return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html)) @admin_app.route('/images', methods=['GET']) @requires_auth @@ -117,4 +118,4 @@ def images(): html = flask.render_template( 'admin/images.html', images=images, order_by=order_by, ascending=ascending ) - return flask.render_template('admin/index.html', user=user, page=flask.Markup(html)) + return flask.render_template('admin/index.html', user=user, page=markupsafe.Markup(html)) diff --git a/iris/main/__init__.py b/iris/main/__init__.py index 4ebc150..df06bd9 100644 --- a/iris/main/__init__.py +++ b/iris/main/__init__.py @@ -2,6 +2,7 @@ import json import flask +import markupsafe import numpy as np from PIL import Image as PILImage from skimage.transform import resize @@ -92,7 +93,7 @@ def metadata(image_id): if flask.request.args.get('safe_html', False): metadata = { - k: flask.Markup(str(v)) + k: markupsafe.Markup(str(v)) for k, v in metadata.items() } diff --git a/iris/project.py b/iris/project.py index bf026c7..9c435b3 100644 --- a/iris/project.py +++ b/iris/project.py @@ -10,6 +10,8 @@ import re import flask +import markupsafe + import json from matplotlib import cm import numpy as np @@ -95,7 +97,7 @@ def load_from(self, filename): # Make sure the HTML is understood in the descriptions: for name, view in self.config['views'].items(): view['name'] = name - view['description'] = flask.Markup( + view['description'] = markupsafe.Markup( view.get('description', view['name']) ) view['stretch'] = view.get('stretch', 'linear') diff --git a/iris/utils.py b/iris/utils.py index 821d129..7ec89be 100644 --- a/iris/utils.py +++ b/iris/utils.py @@ -1,7 +1,7 @@ from copy import deepcopy import flask - +import markupsafe class View: @@ -12,8 +12,8 @@ def __init__(self, name, description, loader): def to_json(self): return { - 'name': flask.Markup(self.name), - 'description': flask.Markup(self.description), + 'name': markupsafe.Markup(self.name), + 'description': markupsafe.Markup(self.description), } def merge_deep_dicts(d1, d2):