Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0d88fba
Fixes to Tiled
davramov Jun 24, 2026
4edfae3
Adding drag a file/folder functionality that ingests into tiled
davramov Jun 24, 2026
4623979
Classes moved to the top of annotate, and tools are greyed out until …
davramov Jun 24, 2026
122b449
Adding magnetic lasso (edge tracing) and universal erase (works on an…
davramov Jun 24, 2026
e132a87
Adding esc key listener when trying to cancel drawing a shape
davramov Jun 24, 2026
8828213
Vertex adjustment bug fix
davramov Jun 25, 2026
cc3a0d9
Updating .gitignore and adding a button on the Connect page to go dir…
davramov Jun 25, 2026
51dfb98
Making the Connect page a bit clearer what each field does
davramov Jun 25, 2026
8695fa2
making panning work while drawing a shape with the Polygon or Magneti…
davramov Jun 25, 2026
c7fdcfa
Resizable rectangles & ellipses, and larger brush radius allowed
davramov Jun 25, 2026
fa7c208
Adding a magic wand tool
davramov Jun 25, 2026
5042513
Improving magic wand tool
davramov Jun 26, 2026
e68f750
Improving magic wand tool for solid white/dark regions
davramov Jun 26, 2026
95e65c2
Debouncing for sliders
davramov Jun 26, 2026
cb98fdd
Adding Segment Anything capability for the Magic wand tool
davramov Jun 29, 2026
796318f
Improving export/save functionality
davramov Jun 30, 2026
2910ebd
docstrings
davramov Jun 30, 2026
d2d40e8
Linting
davramov Jun 30, 2026
963fd78
Shift+drag to accumulate box selections. Switch selected region(s) to…
davramov Jun 30, 2026
4c78865
Fixing the Browse page
davramov Jun 30, 2026
ed88557
use other classes as anti-examples for segment anything selection
davramov Jul 7, 2026
355f5e7
Iterative improvements... including a docker image
davramov Jul 8, 2026
e48233c
Saving masks to Tiled server
davramov Jul 8, 2026
5b2dea1
Adding some quality of life features for selected regions. Trying to …
davramov Jul 8, 2026
5fbc825
Enable optional clipping of enclosed features. I.e., when annotating …
davramov Jul 9, 2026
f3203c4
Improving the clipping feature
davramov Jul 9, 2026
6f6fcec
cleaning up the histogram slider
davramov Jul 10, 2026
a24666e
Adding a fill tool
davramov Jul 10, 2026
e80528d
Making image adjustment tools more efficient
davramov Jul 13, 2026
b0307de
Improving node editing (new nodes/delete nodes). Adding an Insights p…
davramov Jul 13, 2026
c7034d7
Hardening install/startup, securing tiled keys (automatically generat…
davramov Jul 14, 2026
80ed178
Adjusting CLAHE and ensuring uv is installed during start_all.sh
davramov Jul 14, 2026
1badee1
start_all.sh checks if the tiled port is occupied and iterates to the…
davramov Jul 14, 2026
750a978
applying port finding to frontend/backend
davramov Jul 14, 2026
b4ac66f
tiled api key fix on frontend
davramov Jul 14, 2026
df57367
fixing default tiled port bug
davramov Jul 14, 2026
987c398
Cleaning up the Connect page. Also, now a comma separated list can be…
davramov Jul 14, 2026
1e70982
Adding mkdocs documentation. Adding color-blind friendly color pallet…
davramov Jul 14, 2026
7a4e557
Fixing side bar overflow issue
davramov Jul 14, 2026
6dedfb9
Improving the eraser tool
davramov Jul 14, 2026
ee0c068
Improving tool/cursor visibility
davramov Jul 14, 2026
cfc8e0a
Fixing selection bug
davramov Jul 14, 2026
6398bb1
Fixing some brush/erase bugs where region nodes would unexpectedly sh…
davramov Jul 15, 2026
522a082
Improving brush tool
davramov Jul 15, 2026
71b45cd
Clip-on as default. Brush radius number input. Select all feature. Br…
davramov Jul 15, 2026
7a5d9d5
Adding undo/redo functionality for drawing polygons/magnetic
davramov Jul 15, 2026
290926e
Rebranding to Segmentation Annotation Studio (since it's more than SAM3)
davramov Jul 15, 2026
84cdc40
Adding a Feedback button that links to a Google Form for bug reportin…
davramov Jul 15, 2026
c99cc21
Enabling download of DINO ready masks
davramov Jul 15, 2026
631927d
Updating documentation
davramov Jul 15, 2026
e83fb7c
fixing text overflow error
davramov Jul 15, 2026
414e869
Copy a class+all of its shapes; slimSAM - connected regions only opti…
davramov Jul 16, 2026
5c07661
Solving some thing Lighthouse picked up to improve performance and re…
davramov Jul 16, 2026
f6dd110
untracking cached files, and updating .gitignore
davramov Jul 16, 2026
bf5b44d
Adding .reset-backups/ to .dockerignore
davramov Jul 16, 2026
a9baac0
Adding .reset-backups/ to .gitignore
davramov Jul 16, 2026
b593cb9
linting python import order
davramov Jul 17, 2026
791ccb6
Adding missing dependency
davramov Jul 17, 2026
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
41 changes: 41 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Build artifacts & deps (rebuilt inside the image)
**/node_modules
**/dist
**/.vite
frontend/dist
backend/static

# Python envs / caches
.venv
.conda-py312
**/__pycache__
**/*.pyc
.pytest_cache
htmlcov
.coverage

# Tiled server config, data & catalog (external in production — never bundled)
.tiled
tiled/

# Local data, backups, runtime files
data
.drafts
.reset-backups
*.pid
.run

# VCS / editor / OS
.git
.gitignore
.idea
.vscode
.DS_Store

# Plans / docs not needed in the image
*.md

# peter's version of the repo
peter/

.reset-backups/
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ build/
.env

# Tiled catalog database (binary, regenerated on first run via start_all.sh)
# The zarr data under .tiled/data/ IS committed so clones get demo data.
.tiled/catalog.db
.tiled/catalog.db-shm
.tiled/catalog.db-wal

# Tiled data written at runtime (drag-and-drop ingest, etc.).
# Demo datasets already committed under .tiled/data/ stay tracked; new arrays
# ingested locally are ignored. To commit a new demo dataset, use `git add -f`.
.tiled/data/

# Runtime Tiled thumbnail containers created on save
**/*__v_thumbs/

Expand All @@ -27,6 +31,9 @@ node_modules/
dist/
.vite/

# Production SPA build served by FastAPI (generated by `PROD=1 ./start_all.sh`)
backend/static/

# OS
.DS_Store
Thumbs.db
Expand All @@ -45,3 +52,14 @@ Thumbs.db
htmlcov/
.coverage
coverage.xml

# Vendored SAM model (large, fetched via frontend/scripts/fetch-sam-model.mjs)
frontend/public/models/

# MkDocs build output (regenerate with `mkdocs build`)
site/

# peter's version of the repo
peter/

.reset-backups/
18 changes: 15 additions & 3 deletions .tiled/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ SQLite catalog and sample array data (~1 MB).
- **`catalog.db`** — Tiled catalog metadata (paths, structure, metadata keys).
- **`data/`** — Writable storage (Zarr chunks) for `browse/generated_data/*` sample datasets.

After clone, run `./start_all.sh` from the repo root. The script still creates
`backend/.env` from `.env.example` and may generate a `TILED_API_KEY` if missing;
that key is only for authenticating to the local server, not stored inside these files.
After clone, run `./start_all.sh` from the repo root. The script creates
`backend/.env` from `.env.example` and **generates a strong `TILED_API_KEY`** into it
when the key is missing (or still the old committed value, which it auto-rotates).
`tiled/config.yml` holds no literal key — the script passes the generated key to
Tiled at launch via `--api-key` (robust across Tiled versions). The key lives only
in the gitignored `backend/.env`, never inside these catalog files and never sent
to the frontend.

To replace this with an empty catalog, delete `.tiled/` and run `tiled catalog init`
(see `start_all.sh`). To add more datasets, use `backend/scripts/seed_generated_data_to_tiled.py`.

## Security note
Earlier commits of `tiled/config.yml` contained a hardcoded `single_user_api_key`
(`3b1d23cd…`). It has been removed from the working tree and is auto-rotated on the
next `./start_all.sh`, but it **remains in git history**. It only guards a
local-only (127.0.0.1) server with anonymous read enabled, so exposure is low. To
purge it from history, use `git filter-repo` (or BFG) to replace the blob, then
force-push — destructive; coordinate with anyone who has cloned the repo.
Binary file not shown.
41 changes: 0 additions & 41 deletions .tiled/data/browse/generated_data/gen_010005/zarr.json

This file was deleted.

Binary file not shown.
41 changes: 0 additions & 41 deletions .tiled/data/browse/generated_data/gen_010006/zarr.json

This file was deleted.

Binary file not shown.
41 changes: 0 additions & 41 deletions .tiled/data/browse/generated_data/gen_010007/zarr.json

This file was deleted.

Binary file not shown.
41 changes: 0 additions & 41 deletions .tiled/data/browse/generated_data/gen_010011/zarr.json

This file was deleted.

Binary file not shown.
41 changes: 0 additions & 41 deletions .tiled/data/browse/generated_data/gen_010021/zarr.json

This file was deleted.

2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AGENTS.md — SAM3 Annotation Studio
# AGENTS.md — Segmentation Annotation Studio

## Stack
- Backend: FastAPI, Python ≥ 3.11, pyproject.toml, pytest
Expand Down
14 changes: 14 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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.

If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Intellectual Property Office at
IPO@lbl.gov.

NOTICE. This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights. As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit others to do so.
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# syntax=docker/dockerfile:1
# Lightweight production image: builds the SPA and serves it from the FastAPI
# backend (single container, one port). Tiled is NOT included — point the app at
# an external Tiled via TILED_URI/TILED_API_KEY. Local dev still uses start_all.sh.

# --- Stage 1: build the frontend (same-origin: VITE_API_BASE left empty) ---
FROM node:22-alpine AS web
WORKDIR /web
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build # → /web/dist

# --- Stage 2: backend + built SPA ---
FROM python:3.12-slim AS app
WORKDIR /app

# Install Python deps first (cached until pyproject changes). py-modules=[] means
# this installs dependencies only; the app code runs from the copied source below.
# pyproject pins tiled[client] (not [all]/[server]), so the Tiled server is NOT
# installed into this image — the app only connects to an external Tiled.
# If a wheel is unavailable for pycocotools/imagecodecs on this platform, add:
# RUN apt-get update && apt-get install -y --no-install-recommends build-essential
COPY backend/pyproject.toml ./pyproject.toml
RUN pip install --no-cache-dir .

# App source + the built SPA (served from ./static by annotation_server.py).
COPY backend/ ./
COPY --from=web /web/dist ./static

# Drafts/versions/exports persist here — mount a volume in production.
ENV LOCAL_DATA_ROOT=/data
VOLUME ["/data"]

EXPOSE 8002
CMD ["uvicorn", "annotation_server:app", "--host", "0.0.0.0", "--port", "8002"]
Loading
Loading