Skip to content

Commit

Permalink
fix: broken slice creation not covered by unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
provos committed Jun 23, 2024
1 parent d0130ee commit 6984340
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from instance import SegmentationModel
from inpainting import InpaintingModel, create_inpainting_pipeline
from clientside import make_clientside_callbacks
from slice import ImageSlice


import dash
Expand Down Expand Up @@ -523,6 +524,9 @@ def generate_depth_map_callback(ignored_data, filename, model):
state.depthMapData = generate_depth_map(
np_image, model=state.depth_estimation_model, progress_callback=progress_callback)
state.imgThresholds = None

state.to_file(filename, save_image_slices=False,
save_depth_map=True, save_input_image=False)

return True, ""

Expand Down Expand Up @@ -773,8 +777,10 @@ def create_single_slice_request(n_clicks, filename, logs):
depth = state.slice_pixel_depth
image = create_slice_from_mask(
state.imgData, state.slice_mask, num_expand=EXPAND_MASK)
state.selected_slice = state.add_slice(image, depth)
state.save_image_slice(state.selected_slice)

image = ImageSlice(image, depth)
state.selected_slice = state.add_slice(image)
image.save_image()
state.to_file(filename, save_image_slices=False,
save_depth_map=False, save_input_image=False)

Expand Down

0 comments on commit 6984340

Please sign in to comment.