Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update UI + latest yolov5 sources #15

Merged
merged 32 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
980a554
merge latest version done, not tested
mkolomeychenko Apr 29, 2021
5aae1c8
split tabs with radio buttons
mkolomeychenko Apr 29, 2021
ee16e3f
models table -wip
mkolomeychenko Apr 29, 2021
dc8e78c
models table -wip
mkolomeychenko Apr 29, 2021
a878179
start split html template to parts
mkolomeychenko Apr 30, 2021
236e62d
ui refactoring
mkolomeychenko Apr 30, 2021
db61ef4
compile-template wip - paths confusion
mkolomeychenko Apr 30, 2021
2eae9b2
compile wip
mkolomeychenko Apr 30, 2021
3455a45
train/val splits
mkolomeychenko Apr 30, 2021
9591dd1
keep/ignore unlabeled images
mkolomeychenko Apr 30, 2021
89bddaa
models table
mkolomeychenko Apr 30, 2021
71c5710
training hyperparameters
mkolomeychenko May 4, 2021
88cb140
UI templates - done
mkolomeychenko May 4, 2021
5aacc66
unlabeled count in UI
mkolomeychenko May 5, 2021
e014b75
add adam optimizer
mkolomeychenko May 5, 2021
dfd58b1
convert_project to detection - works
mkolomeychenko May 5, 2021
0aec05b
start train/val splits
mkolomeychenko May 5, 2021
0072702
splits wip
mkolomeychenko May 5, 2021
8478e17
splits done, only simple tests
mkolomeychenko May 6, 2021
d65e4bc
splits validation
mkolomeychenko May 6, 2021
6bb0c91
data preprocessing - not tested
mkolomeychenko May 6, 2021
0433ae3
download weights - wip
mkolomeychenko May 7, 2021
55abdb5
init_script_arguments - not tested
mkolomeychenko May 7, 2021
050407a
init_script_arguments - not tested
mkolomeychenko May 7, 2021
88930f9
prepare weights - wip
mkolomeychenko May 7, 2021
2ab8ed1
not tested
mkolomeychenko May 7, 2021
3355946
add metrics period
mkolomeychenko May 7, 2021
6182567
set output
mkolomeychenko May 7, 2021
8b361b3
artifacts dirs
mkolomeychenko May 7, 2021
d790a2f
train_batches_uploaded flag
mkolomeychenko May 7, 2021
5aad4b1
pre-release for debug
mkolomeychenko May 7, 2021
52893b5
update config
mkolomeychenko May 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
start split html template to parts
  • Loading branch information
mkolomeychenko committed Apr 30, 2021
commit a878179125f5336e150ab910887e7abf1ff11641
1 change: 1 addition & 0 deletions supervisely/train/debug.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PYTHONUNBUFFERED=1

DEBUG_APP_DIR="/app_debug_data"
DEBUG_CACHE_DIR="/app_cache"
LOG_LEVEL="debug"

TASK_ID=4212

Expand Down
16 changes: 7 additions & 9 deletions supervisely/train/src/gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@
#yolov5-train .el-tabs.el-tabs-cards .el-tabs__item { flex: 1; margin-bottom: -3px; padding: 9px 16px 13px;
height: auto; line-height: normal; border-radius: 4px; }
</sly-style>
<sly-card title="1. Input Project" subtitle="This project will be used for training">
<sly-field title="" description="Project">
<a slot="title" target="_blank"
:href="`/projects/${data.projectId}/datasets`">{{data.projectName}} ({{data.projectImagesCount}}
images)</a>
<sly-icon slot="icon" :options="{ imageUrl: `${data.projectPreviewUrl}` }"/>
</sly-field>
</sly-card>

<div>input_project.html</div>

<sly-card class="mt15"
title="2. Training classes"
subtitle="Select classes, that should be used for training. Training supports only classes of shape
Expand Down Expand Up @@ -192,7 +187,10 @@
<table class="beautiful-table">
<thead>
<tr>
<th>Model</th>
<th>
<div>Model</div>
<div>pixels</div>
</th>
<th>Params (P)</th>
<th>Params (V)</th>
</tr>
Expand Down
8 changes: 8 additions & 0 deletions supervisely/train/src/gui_parts/input_project.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<sly-card title="1. Input Project" subtitle="This project will be used for training">
<sly-field title="" description="Project">
<a slot="title" target="_blank"
:href="`/projects/${data.projectId}/datasets`">{{data.projectName}} ({{data.projectImagesCount}}
images)</a>
<sly-icon slot="icon" :options="{ imageUrl: `${data.projectPreviewUrl}` }"/>
</sly-field>
</sly-card>
25 changes: 24 additions & 1 deletion supervisely/train/src/sly_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ def train(api: sly.Api, task_id, context, state, app_logger):
my_app.stop()


def compile_template(main_file, parts_directory, res_path):
with open(main_file, 'r') as file:
template = file.read()

result = str(template)
files = sly.fs.list_files(parts_directory, [".html"])
for path in files:
name = sly.fs.get_file_name_with_ext(path)
with open(path, 'r') as file:
html = file.read()
result = result.replace(f"<div>{name}</div>", html)

with open(res_path, "w") as file:
file.write(result)
return res_path


def main():
sly.logger.info("Script arguments", extra={
"context.teamId": team_id,
Expand All @@ -95,10 +112,16 @@ def main():
# read project information and meta (classes + tags)
init_project_info_and_meta()

# compile html template to a single file from multiple parts
template_path = os.path.join(g.root_source_path, "supervisely/train/src/gui.html")
parts_dir = os.path.join(g.root_source_path, "supervisely/train/src/gui_parts")
res_path = os.path.join(my_app.data_dir, "gui.html")
compile_template(template_path, parts_dir, res_path)

# init data for UI widgets
ui.init(data, state)

my_app.run(data=data, state=state)
my_app.run(template_path=res_path, data=data, state=state)


# New features:
Expand Down