Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vorozhkog committed Sep 13, 2024
1 parent b54ee80 commit 51e5333
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/compute/layers/processing/SplitDataLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def process(self, data_el: Tuple[ImageDescriptor, Annotation]):

def _split_by_percent() -> List[Tuple[ImageDescriptor, Annotation]]:
new_item_desc = deepcopy(item_desc)
split_ratio = self.settings.get("split_ratio", 0.5)
split_num = total_items_cnt * split_ratio
split_ratio = self.settings.get("split_ratio", 50)
split_num = total_items_cnt * split_ratio / 100
split_index = int(item_idx / split_num) + (item_idx % split_num > 0)
dataset = f"split_{split_index}"
new_item_desc.res_ds_name = dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
get_text_font_size,
)


def create_layout_widgets():
# Layout
layout_text = Text("Change split method", status="text", font_size=get_text_font_size())
layout_text = Text("Select split method", status="text", font_size=get_text_font_size())
layout_edit_button = Button(
text="EDIT",
icon="zmdi zmdi-edit",
Expand Down Expand Up @@ -40,4 +41,4 @@ def create_layout_widgets():
layout_container,
# Preview
layout_current_method,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ def create_sidebar_widgets():
# Sidebar Initialization widgets

sidebar_percent_slider = Slider(
show_input=True, show_input_controls=True, min=0.01, max=1, step=0.01, value=0.5
show_input=True, show_input_controls=True, min=1, max=100, step=1, value=50
)
sidebar_percent_field = Field(
sidebar_percent_slider,
"Select percentage",
"Select percentage by which to distribute images across datasets",
)

sidebar_number_input = InputNumber(min=1, max=100, value=10)
sidebar_number_input = InputNumber(min=1, max=100, value=50)
sidebar_number_field = Field(
sidebar_number_input,
"Select number of images",
Expand Down

0 comments on commit 51e5333

Please sign in to comment.