Spaces:
Sleeping
Sleeping
Commit History
-
HF infra: install Tesseract in image; add .dockerignore
- Dockerfile: apt-get install tesseract-ocr so OCR scale-bar / footer auto-calibration works in the Space (pytesseract degrades gracefully if it were missing, but we want the feature on). - .dockerignore: drop .git, .claude, caches, logs, venvs, local results/uploads, and the desktop launcher scripts from the build context — smaller, faster image builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>9eb53fe -
Sync analysis UI from RodSizer; refresh index docs (keep session + HF notice)
- analysis.html: replace with the current RodSizer analysis page (interactive overlay with thin vivid outlines + two-blink flash, point-in-polygon click-to-deselect that no longer scrolls the table, sortable selection table, ⋮ bulk select/deselect above/below, "Deselect outliers" (Tukey IQR), toggle ID labels hidden by default, PDF that composites the live overlay). Re-grafted the session_id fetch wrapper and appended session_id to the processed/binary image src so the public build stays session-scoped. - index.html: update the About modal (watershed + OCR + rotated-box) and Upload Instructions (metadata -> OCR -> manual calibration order; on-page curation tools), keeping the HF data-retention notice, credits/links and session wiring. Fix the retention notice to match the backend TTL (24 h, was "15 mins"). - folder_analysis.html unchanged (already current bar the session block). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>911d85d -
Sync detection engine from RodSizer: watershed splitting + OCR calibration
Bring the public web backend up to date with the local app's improvements, keeping the session-scoped storage model unchanged: - processing.py / autodetect_utils.py / utils.py copied wholesale (they are session-agnostic — they operate on the dirs main.py passes in). This adds: distance-transform watershed clump splitting (replaces rUECS as the primary separator; dense clumps no longer collapse into one blob), bounding-box measurement with find_objects + localized NMS (faster), and OCR scale-bar / footer auto-calibration for camera exports with no embedded metadata. - requirements.txt: add pytesseract (OCR); drop the unused tensorflow + stardist (huge dead deps — major HF build-time / image-size win) and matplotlib (no longer imported). - main.py: RESULTS_SCHEMA_VERSION 2 -> 6 so old cached results regenerate with the new engine; serve the frontend HTML with no-cache headers. main.py's /process and /process/{id}/binary_preview already passed binary_mask_tune and called …4caef13
-
Fix image_id validator: accept <uuid>_<name> upload format
Uploads are stored with stems of the form "<uuid>_<sanitized_filename>", but _validate_image_id only accepted bare UUIDs, so every /process/{id} call 400'd with "Invalid image id". Relaxes _IMAGE_ID_RE to accept an optional "_<rest>" suffix while still rejecting control chars, path separators, and glob metacharacters. Also replaces rglob(f"{image_id}.*") / glob(f"{image_id}*") with explicit stem/name comparison so image_id can never be interpreted as a glob pattern even if validation is bypassed.e96a12f -
Harden session/path/ID validation and fix XSS for public-facing web version
Session IDs, image IDs, folder names, and result filenames flow directly into filesystem paths in /tmp/uploads/<session>/ and /tmp/results/<session>/. Because this build runs on public Hugging Face Spaces, an attacker could previously use ../ in session_id or filename to read/write other sessions or arbitrary container paths. - Enforce a strict format for session_id (8–128 chars, [A-Za-z0-9_-]) and reject traversal tokens; resolve per-session dirs under the root. - Validate image_id as UUID4 before any rglob() to block glob-metacharacter injection. - Sanitize folder names (reject "." / ".." / separators) and _safe_join them under the session upload dir. - Rewrite /results/{filename} to forbid traversal, glob metacharacters, and control chars, and verify the resolved path stays inside the session dir. - Rebuild gallery cards and table rows with DOM APIs so user-supplied filenames and IDs cannot inject HTML or inline-event handlers. - Cap upload size (200 MB per file) and file…6e77125
-
Fix image display: append session_id to img.src URLs
59f5e9f -
Add line break in credits before See HERE line
620e9a3 -
Simplify About modal credits section
0fcbf72 -
Remove warning icon and tone down RodSizer_local link style
57373bb -
Redesign header warning notice with better styling
3de6cb1 -
Improve header notice visibility and accuracy
bf359a4 -
Add web demo notice with session/storage warning in header
02ad7eb -
Auto-cleanup session dirs older than 24h to prevent storage overflow
27af115 -
Add per-session file isolation for multi-user support
de3e784 -
Make Murphy's Group and HERE into hyperlinks in About section
86f3dca -
Update credits in About section
bb552ac -
Fix ModuleNotFoundError by setting PYTHONPATH
6b12ae9 -
Fix libgl1-mesa-glx -> libgl1 for Debian trixie
69cbd6a -
Add HF Spaces metadata to README
13a9100 -
Convert images to Git LFS
cab600a -
Track binary files with Git LFS
a60d8f3 -
Add Dockerfile for HF Spaces deployment
c4f5776 -
Initial commit
065e391