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

Onsite dev #58

Merged
merged 44 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1a9e04a
Implement delete all function
tamidodo Jul 13, 2023
62e736b
🚸 preserve zoom and pan on image change
danton267 Jul 14, 2023
e603bb6
🔀 Merge branch 'main' into preserve-zoom-and-pan
hannahker Jul 14, 2023
6471e4a
:whale: Add action to publish Docker image
Wiebke Jul 14, 2023
414c432
Merge pull request #42 from mlexchange/preserve-zoom-and-pan
hannahker Jul 18, 2023
2f15cec
Center layout
MinaMirz Jul 18, 2023
a2d5401
Format with black
MinaMirz Jul 18, 2023
02ade52
💄 Minor fixes to make image bigger
hannahker Jul 19, 2023
3d1939a
Merge pull request #47 from mlexchange/center-layout
hannahker Jul 19, 2023
0e9d241
📝 Update README.md
danton267 Jul 20, 2023
e749003
Merge pull request #48 from mlexchange/update-readme-with-instruction…
hannahker Jul 20, 2023
32eead2
add custom class generation
tamidodo Jul 20, 2023
7641555
Merge branch 'main' into update-annotation-ui
tamidodo Jul 20, 2023
57db682
Merge pull request #50 from mlexchange/update-annotation-ui
hannahker Jul 24, 2023
a4bfa4a
🐛 fix bugs in image_shape
hannahker Jul 24, 2023
ef563c2
🔀 merge main
hannahker Jul 24, 2023
6a0a406
🐛 reference user-defined classes
hannahker Jul 24, 2023
c4dd7d2
🎨 delete comments
hannahker Jul 24, 2023
928051a
🔀 Merge 'annotation-exporting' into ing-hannah
danton267 Jul 26, 2023
54d83c1
:whale: Add container_name to app
Wiebke Jul 26, 2023
82e04eb
Remove quotes '...' from .env instructions
Wiebke Jul 26, 2023
52ae4f9
🐛 restructure label_mapping key in store
hannahker Jul 26, 2023
83337c4
♻️ add back pieces to account for class mapping
hannahker Jul 26, 2023
effac06
➕ add dependencies
hannahker Jul 26, 2023
12c139f
➕ fix requirement
hannahker Jul 26, 2023
ff63a75
:whale: Change port to 8075
Wiebke Jul 26, 2023
2ed4311
✏️ fix typo in requirements.txt
hannahker Jul 26, 2023
cf3ff44
💄 add section for model controls
hannahker Jul 26, 2023
06de215
💄 hide save annotation button for now
hannahker Jul 26, 2023
026d256
🎨 apply black
hannahker Jul 26, 2023
ff26237
:whale: Add volume mounts and compute api network
Wiebke Jul 26, 2023
f6bd89f
✨ add placeholder for model running callback
hannahker Jul 26, 2023
4db3000
🎨 black again
hannahker Jul 26, 2023
790b44c
Merge pull request #59 from mlexchange/actions-for-spin-deployment
hannahker Jul 26, 2023
2367f64
🎨 create new callbacks file for segmentation code
hannahker Jul 26, 2023
37c8cbe
✨ start fleshing out model running function
hannahker Jul 26, 2023
0792909
🎨 black again...
hannahker Jul 27, 2023
19ad685
Merge branch 'annotation-exporting' into onsite-dev
hannahker Jul 27, 2023
f827202
✨ name files according to slice index
hannahker Jul 27, 2023
cc06c37
🥅 catch case where there are no annotations
hannahker Jul 28, 2023
fcd9ae2
🐛 test removing layout
hannahker Jul 28, 2023
3d37ca1
test with empty children
hannahker Jul 28, 2023
dd6749a
add layout back
hannahker Jul 28, 2023
4d641b5
add callback back
hannahker Jul 28, 2023
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
45 changes: 45 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Create and publish image

on:
push:
branches: ['main']
tags: ['v*']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.9

# Create and set working directory
WORKDIR /app

# Install Python dependencies
RUN python -m pip install --upgrade pip
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the remainder of the code into the image
COPY . ./

EXPOSE 8075
# Run Dash app with gunicorn
CMD ["gunicorn", "-b", "0.0.0.0:8075", "--reload", "app:server"]
# Better than the alternative running of app.py directly with
#CMD ["python", "app.py"]
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pip install -r requirements.txt
2. Configure a connection to the Tiled server via a `.env` file with the following environment variables:

```
TILED_URI='https://mlex-segmentation.als.lbl.gov'
API_KEY='<key-provided-on-request>'
TILED_URI=https://mlex-segmentation.als.lbl.gov
API_KEY=<key-provided-on-request>
```

3. Start a local server:
Expand All @@ -24,6 +24,15 @@ API_KEY='<key-provided-on-request>'
python app.py
```

### Local tiled connection

To start local tiled connection:
1. Add `SERVE_LOCALLY=True` flag to `env` file (or to your environmental variables)
2. Start the app once, which will create `data/` directory and download 2 sample projects with 2 images each.
3. Open a second terminal and run `tiled serve directory --public data`.

The app will now connect to the local tiled server.

# Copyright
MLExchange Copyright (c) 2023, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Expand Down
6 changes: 4 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from dash import Dash
from dash import Dash, dcc
import dash_mantine_components as dmc
from components.control_bar import layout as control_bar_layout
from components.image_viewer import layout as image_viewer_layout
from callbacks.image_viewer import *
from callbacks.control_bar import *
from callbacks.segmentation import *

app = Dash(__name__)
server = app.server
Expand All @@ -16,7 +17,8 @@
control_bar_layout(),
image_viewer_layout(),
],
)
),
dcc.Store(id="current-ann-mode"),
],
)

Expand Down
13 changes: 6 additions & 7 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* These css classes highlight the selected annotation color (class) */
.flex-row {
display: flex;
flex-direction: row;
}

.red>.red-icon,
.grape>.grape-icon,
.violet>.violet-icon,
.blue>.blue-icon,
.yellow>.yellow-icon {
border: 3px solid black;
.mantine-Grid-col>.mantine-1avyp1d {
margin: auto;
}
Loading
Loading