Skip to content

Commit

Permalink
fix table selection, optimize app launch, update sly version (#34)
Browse files Browse the repository at this point in the history
* Update and rename requirements.txt to dev_requirements.txt

* fix classes selection table

* Delete dev_requirements.txt

* Update dev_requirements.txt

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update config.json

* Update config.json

* Update dev_requirements.txt

* Update Dockerfile

* Update Dockerfile

* Update config.json

* Update config.json

* Update Dockerfile

* Update config.json

* Update config.json

* Update and rename manual-build-push-docker-image.yml to build_image.yml

---------

Co-authored-by: Pavel Bartsits <[email protected]>
  • Loading branch information
peixed351 and cxnt authored Jul 11, 2023
1 parent 5d72dc6 commit db5b9b7
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
name: Docker Image CI
name: Docker Image Build

on:
on:
workflow_dispatch:
inputs:
tag_version:
description: 'Docker Image Tag'
description: "Docker Image Tag"
required: true
default: ''
default: ""

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
Expand Down
12 changes: 12 additions & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
supervisely==6.72.66

openmim
ffmpeg-python==0.2.0
pyyaml==6.0

# torch==1.13.0
# torchvision==0.14.0

# mmcv-full==1.7.0
# mmsegmentation==0.29.1
# mmcls==0.24.1
11 changes: 10 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
FROM supervisely/base-py-sdk:6.36.0
FROM supervisely/base-py-sdk:6.72.66

RUN pip3 install -U torch==1.10.0+cu111 torchvision==0.11.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip3 install mmcv-full==1.4.4 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.10.0/index.html -U
# RUN pip3 install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.12/index.html -U

# RUN pip3 install mmcv-full==1.7.0
RUN pip3 install mmsegmentation==0.23.0
RUN pip3 install mmcls==0.21.0
RUN pip3 install pyyaml==6.0

# RUN pip3 install torch==1.13.0
# RUN pip3 install torchvision==0.14.0
RUN pip3 install ffmpeg-python==0.2.0

COPY dev_requirements.txt dev_requirements.txt
RUN pip3 install -r dev_requirements.txt

RUN mkdir -p /tmp/mmseg \
&& wget https://github.com/open-mmlab/mmsegmentation/archive/refs/tags/v0.23.0.tar.gz -P /tmp/mmseg \
&& tar -xvf /tmp/mmseg/v0.23.0.tar.gz -C /tmp/mmseg
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion serve/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"serve"
],
"description": "Deploy model as REST API service",
"docker_image": "supervisely/mmseg:1.3.1",
"docker_image": "supervisely/mmseg:1.3.4",
"instance_version": "6.6.7",
"entrypoint": "python -m uvicorn main:m.app --app-dir ./serve/src --host 0.0.0.0 --port 8000 --ws websockets",
"port": 8000,
Expand Down
9 changes: 0 additions & 9 deletions serve/dev_requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion train/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"train"
],
"description": "Dashboard to configure, start and monitor training",
"docker_image": "supervisely/mmseg:1.3.1",
"docker_image": "supervisely/mmseg:1.3.4",
"instance_version": "6.4.57",
"main_script": "train/src/main.py",
"gui_template": "train/src/gui.html",
Expand Down
135 changes: 88 additions & 47 deletions train/src/ui/classes.html
Original file line number Diff line number Diff line change
@@ -1,57 +1,98 @@
<sly-card title="Training classes"
subtitle="Select classes, that should be used for training. Training supports only classes of shapes Polygon
<sly-card
title="Training classes"
subtitle="Select classes, that should be used for training. Training supports only classes of shapes Polygon
and Bitmap. Other classes are ignored"
:options="{collapsable: true}"
:collapsed.sync="state.collapsed3"
:disabled="{disabled: state.disabled3, message: 'Prepare train/val splits at step 2 before selection classes'}"
ref="step3"
:options="{collapsable: true}"
:collapsed.sync="state.collapsed3"
:disabled="{disabled: state.disabled3, message: 'Prepare train/val splits at step 2 before selection classes'}"
ref="step3"
>
<sly-el-table-selection-container
:data="data.classes"
:selected="state.selectedClasses"
identity-field="title"
>
<el-table
class="ultra-table"
:data="data.classes"
style="width: 100%"
max-height="500"
:disabled="data.done3"
@selection-change="
ref="sly-el-table-with-selection"
class="ultra-table"
:data="data.classes"
style="width: 100%"
max-height="500"
:disabled="data.done3"
@selection-change="
(val) => {
state.selectedClasses = val.map(x => x.title);
}
"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="Name" prop="title" sortable>
<template scope="scope">
<i class="zmdi zmdi-circle mr5" :style="{color: scope.row.color}"></i>
{{ scope.row.title }}
</template>
</el-table-column>
<el-table-column prop="shape" label="Shape" sortable width="180"></el-table-column>
<el-table-column prop="imagesCount" label="Images count" sortable width="150"></el-table-column>
<el-table-column prop="objectsCount" label="Objects count" sortable width="180"></el-table-column>
<el-table-column prop="areaPercent" label="Area percent" sortable width="150"></el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="Name" prop="title" sortable>
<template scope="scope">
<i class="zmdi zmdi-circle mr5" :style="{color: scope.row.color}"></i>
{{ scope.row.title }}
</template>
</el-table-column>
<el-table-column
prop="shape"
label="Shape"
sortable
width="180"
></el-table-column>
<el-table-column
prop="imagesCount"
label="Images count"
sortable
width="150"
></el-table-column>
<el-table-column
prop="objectsCount"
label="Objects count"
sortable
width="180"
></el-table-column>
<el-table-column
prop="areaPercent"
label="Area percent"
sortable
width="150"
></el-table-column>
</el-table>
<sly-field title="INFO: Background Class"
description="background class (name: __bg__, color: [0, 0, 0]) will be added automatically"
style="padding-top: 0; padding-bottom: 0; margin: 10px 5px;">

<sly-icon slot="icon" :options="{ color: '#13ce66', bgColor: '#e1f7eb', rounded: false }">
<i class="zmdi zmdi-info"></i>
</sly-icon>
</sly-field>
</sly-el-table-selection-container>
<sly-field
title="INFO: Background Class"
description="background class (name: __bg__, color: [0, 0, 0]) will be added automatically"
style="padding-top: 0; padding-bottom: 0; margin: 10px 5px"
>
<sly-icon
slot="icon"
:options="{ color: '#13ce66', bgColor: '#e1f7eb', rounded: false }"
>
<i class="zmdi zmdi-info"></i>
</sly-icon>
</sly-field>

<el-button type="primary" class="regular mt10"
@click="command('use_classes')"
:disabled="state.selectedClasses.length < 1"
v-if="!data.done3">
Use {{state.selectedClasses.length}} selected classes
</el-button>
<div v-if="data.done3">
<i class="zmdi zmdi-check-circle ml5 mr5 mt10" style="color: #13ce66"></i>
<span style="color: #5a6772;">Selected {{state.selectedClasses.length}} classes</span>
</div>
<el-button type="warning" class="regular mt10" :plain="true"
@click="state.restartFrom = 3;"
v-if="data.done3 && state.selectedClasses.length > 0 && !state.started">
<i class="zmdi zmdi-rotate-left mr5"></i> Select other classes
</el-button>
</sly-card>
<el-button
type="primary"
class="regular mt10"
@click="command('use_classes')"
:disabled="state.selectedClasses.length < 1"
v-if="!data.done3"
>
Use {{state.selectedClasses.length}} selected classes
</el-button>
<div v-if="data.done3">
<i class="zmdi zmdi-check-circle ml5 mr5 mt10" style="color: #13ce66"></i>
<span style="color: #5a6772"
>Selected {{state.selectedClasses.length}} classes</span
>
</div>
<el-button
type="warning"
class="regular mt10"
:plain="true"
@click="state.restartFrom = 3;"
v-if="data.done3 && state.selectedClasses.length > 0 && !state.started"
>
<i class="zmdi zmdi-rotate-left mr5"></i> Select other classes
</el-button>
</sly-card>

0 comments on commit db5b9b7

Please sign in to comment.