From d83a1b01a0566725cf688e98b4def3e55b6873f9 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 5 Apr 2022 22:20:13 +0200 Subject: [PATCH 1/2] Stacking preview --- hti/server/api/stacking_api.py | 7 +++++-- hti/server/stacking/image_stacker.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hti/server/api/stacking_api.py b/hti/server/api/stacking_api.py index 9dbfda2..3cd3581 100644 --- a/hti/server/api/stacking_api.py +++ b/hti/server/api/stacking_api.py @@ -51,7 +51,7 @@ def post(self): Frame.interpolate_angles(frames) image_stacker = get_image_stacker() - image_stacker.light_frames = frames[:10] + image_stacker.light_frames = frames[:10] # TODO use all frames, provide a range option image_stacker.stack_image() # Update hash in app state so FE can react by reloading the preview @@ -69,7 +69,10 @@ class StackedImagePreviewApi(Resource): def get(self, stacked_image_hash): image_stacker = get_image_stacker() if image_stacker.get_stacked_image_hash() == stacked_image_hash: - image_data_png = image_stacker.get_stacked_image(format='png') + image_data_png = image_stacker.get_stacked_image( + format='png', + scale_factor=2 + ) return send_file(image_data_png, mimetype='image/png') # TODO hash is outdated - maybe update it with whatever is new? diff --git a/hti/server/stacking/image_stacker.py b/hti/server/stacking/image_stacker.py index 59fd58a..b5a217d 100644 --- a/hti/server/stacking/image_stacker.py +++ b/hti/server/stacking/image_stacker.py @@ -27,14 +27,17 @@ def __init__(self): def get_stacked_image_hash(self) -> str: """ Get a hash of all the parameters that went into stacked_image - so we can be smart about re-stacking only if settings change. + so we can be smart about re-stacking and fetching the updated + result only if any settings changed. """ # TODO crazy stupid hashing return str(len(self.light_frames)) @staticmethod def normalize_image(image): - + """ + Fit dynamic range found in the given image into [0;1]. + """ normalized_image = np.zeros(image.shape, dtype=image.dtype) for channel in range(image.shape[2]): From a72b739454cb10dea785a5e8c962c87063d24ade Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 04:15:13 +0000 Subject: [PATCH 2/2] Bump numpy from 1.20.2 to 1.22.0 in /color_calibration Bumps [numpy](https://github.com/numpy/numpy) from 1.20.2 to 1.22.0. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.20.2...v1.22.0) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- color_calibration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/color_calibration/requirements.txt b/color_calibration/requirements.txt index 711d080..a305b5a 100644 --- a/color_calibration/requirements.txt +++ b/color_calibration/requirements.txt @@ -1,2 +1,2 @@ -numpy==1.20.2 +numpy==1.22.0 tensorflow==2.4.1