Skip to content

Publish FocalNet checkpoints on Hugging Face - #7

Merged
TorstenDittmann merged 7 commits into
mainfrom
torsten/publish-huggingface-da15
Sep 18, 2026
Merged

TorstenDittmann merged 7 commits into
mainfrom
torsten/publish-huggingface-da15

Conversation

@TorstenDittmann

@TorstenDittmann TorstenDittmann commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Pretrained FocalNet weights are published to the existing Hub repo appwrite/focalnet and attached to the 2026-09-14-rc1 GitHub release.

What changed

  • Added a versioned model card at docs/huggingface-model-card.md and scripts/publish-huggingface.py, which refuses to upload unless SHA-256 matches the documented reference hashes, hashes sit next to the matching filenames, example images exist, and ONNX sidecars match embedded metadata.
  • README, result notes, and the crop lab fetch focalnet-human.onnx from Hugging Face by default (bun run fetch-model) and verify the published hash. An empty FOCALNET_ONNX_SHA256 still verifies.
  • Hub examples are stacked source/center/FocalNet figures rendered from Autogravity photographs. The renderer takes model, photo, output, and font paths and falls back to DejaVu/Liberation when Inter is missing.
  • The GitHub release keeps the model files: importance and ranking ONNX, JSON sidecars, PyTorch checkpoints, and checksums. Example images and the model card stay on Hugging Face.
  • Download examples use curl / urllib so a runtime-only pip install . environment can fetch weights without Hugging Face CLI packages.
  • Weights stay gitignored. CPC/GAICD dataset-rights caveats stay in the card and README.
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 18, 2026 08:31
Add a model card and upload helper that verify the documented SHA-256
hashes, and point the README and crop lab at appwrite/focalnet.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
The fetch-model default must match the published resolve URL string so
hash and docs checks can find it in source.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
Drop the Microsoft FocalNet disclaimer and show center versus FocalNet
crops on Autogravity's park and portrait photographs.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
@TorstenDittmann
TorstenDittmann marked this pull request as ready for review September 18, 2026 08:45
@greptile-apps

greptile-apps Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge despite a non-blocking defect in the exported fetch helper’s custom-destination dummy fallback.

Fix All in Claude CodeFindings

  1. P2 Dummy Ignores Custom Destination ▶
Fix with agent prompt
### Issue 1
web/scripts/fetch-model.ts:109-117
When a caller enables dummy mode with a non-default `destPath`, the exporter still writes the model to the hardcoded `web/public/focalnet-human.onnx`. `fetchModel` then hashes the requested path, which was never created, so the call rejects after claiming it wrote the dummy. Pass the requested destination to the exporter or create the dummy directly at `destPath`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR publishes verified FocalNet checkpoints and supporting model-card assets, adds guarded Hugging Face staging and upload tooling, makes the browser model fetcher use the published ranking checkpoint by default, and adds rendering and publishing tests.

  • Checkpoint hashes and ONNX sidecar metadata are validated before publication.
  • Model-card image and filename/hash associations are checked during staging.
  • Browser downloads now verify the default checkpoint hash, including when the hash environment variable is empty.
  • Runtime-only download examples no longer require Hugging Face CLI dependencies.
  • The dummy-model fallback mishandles the newly configurable destination path.

Reviews (4) · Last reviewed commit: "Verify ONNX sidecars after all Hub files..."

Comment thread web/scripts/fetch-model.ts Outdated
Comment thread scripts/publish-huggingface.py Outdated
Comment thread README.md Outdated
Comment thread scripts/publish-huggingface.py Outdated
Comment thread web/src/fetch-model.test.ts Outdated
cursoragent and others added 2 commits September 18, 2026 08:49
The 2026-09-14-rc1 release now carries the same ONNX, PyTorch, model
card, and Autogravity example files published on the Hub.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
Markdown tables mixed wide sources with square crops and looked broken
on the Hub. Render labeled source/center/FocalNet figures from the
Autogravity photographs instead.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
Comment thread scripts/render-hub-examples.py Outdated
cursoragent and others added 2 commits September 18, 2026 09:14
Empty SHA-256 overrides still verify, the publisher pairs hashes and
example images and checks ONNX sidecars, and download docs use curl
instead of undeclared Hub tooling.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
The publisher copied checkpoints in name order, so sidecar JSON was
checked before it landed in the staging directory.

Co-authored-by: Torsten Dittmann <TorstenDittmann@users.noreply.github.com>
Comment thread web/scripts/fetch-model.ts
@TorstenDittmann
TorstenDittmann merged commit f3c55ae into main Sep 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants