Download connect.html from SharpMeow/ink-lens: direct link, hf CLI and curl.
- Browser
- Download file 17.5 kB
-
https://huggingface.co/spaces/SharpMeow/ink-lens/resolve/main/connect.html
- Command line
-
hf download hf://spaces/SharpMeow/ink-lens/connect.html
-
curl -L -o connect.html https://huggingface.co/spaces/SharpMeow/ink-lens/resolve/main/connect.html
17.5 kB
| <section class="scc" id="connect" aria-label="Connect your tool"><style>.scc{--a:var(--scc-accent,#4ea8de);color:inherit;font:inherit;line-height:1.5;max-width:60rem} | |
| .scc h2{font-size:1.15em;margin:.2em 0 .3em}.scc h3{font-size:1em;margin:0 0 .2em} | |
| .scc p{margin:.3em 0}.scc a{color:var(--a)} | |
| .scc .scc-src{border:1px solid color-mix(in srgb,currentColor 18%,transparent);border-radius:10px;padding:.7em .9em;margin:.7em 0;background:color-mix(in srgb,currentColor 4%,transparent)} | |
| .scc .scc-meta{font-size:.85em;opacity:.8} | |
| .scc details{border-top:1px solid color-mix(in srgb,currentColor 12%,transparent);padding:.35em 0} | |
| .scc summary{cursor:pointer;font-weight:600;list-style-position:inside} | |
| .scc .scc-b{font-weight:400;font-size:.75em;padding:.05em .5em;border-radius:99px;margin-left:.5em;border:1px solid currentColor;opacity:.75;white-space:nowrap} | |
| .scc .scc-b.ok{color:#3fb37f}.scc .scc-b.src{color:var(--a)}.scc .scc-b.warn{color:#e0a030} | |
| .scc .scc-code{position:relative;margin:.4em 0 .2em} | |
| .scc pre{margin:0;padding:.7em .8em;border-radius:8px;overflow:auto;font-size:.82em;background:color-mix(in srgb,currentColor 9%,transparent);white-space:pre} | |
| .scc code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace} | |
| .scc button.scc-copy{all:unset;box-sizing:border-box;position:absolute;top:.35em;right:.35em;font-size:.75em;line-height:1.4;padding:.1em .6em;border-radius:6px;border:1px solid color-mix(in srgb,currentColor 30%,transparent);background:color-mix(in srgb,currentColor 8%,transparent);color:inherit;cursor:pointer} | |
| .scc button.scc-copy:hover{border-color:var(--a)} | |
| .scc .scc-url{position:relative}.scc .scc-url pre{padding-right:4.5em;white-space:pre-wrap;word-break:break-all} | |
| .scc .scc-go{display:inline-block;margin:.3em 0;padding:.25em .8em;border-radius:6px;border:1px solid var(--a);text-decoration:none} | |
| .scc footer{font-size:.8em;opacity:.75;margin-top:.6em}</style> | |
| <h2>Connect your tool</h2> | |
| <p>The sample segments Ink Lens reads are open data, and each one reads straight from its URL in your own tool. The page is also an API and an MCP server.</p> | |
| <div class="scc-src" id="connect-layers"><h3>Sample layers, PHerc0841 w00 (9.366 um surface volume)</h3> | |
| <p class="scc-meta">CC BY-NC 4.0 (Vesuvius Challenge open data) 路 <a href="https://scrollprize.org/data_browser/PHerc0841" target="_blank" rel="noopener">browse</a></p> | |
| <div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/9.366um-1.2m-113keV-volume-20250821151531.zarr</code></pre></div> | |
| <details><summary>Python (zarr)<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "zarr>=3" fsspec aiohttp | |
| import zarr | |
| root = zarr.open_group("https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/9.366um-1.2m-113keV-volume-20250821151531.zarr", mode="r") # OME-Zarr, zarr v2 | |
| a = root["0"] # level 0 is full resolution; level L is 2**L times coarser | |
| print(a.shape, a.dtype, a.chunks) | |
| block = a[0:64, 2800:2864, 2900:2964] # (z, y, x); reads only the chunks it touches</code></pre></div></details> | |
| <details><summary>villa's vesuvius package<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "vesuvius[volume-only]" | |
| from vesuvius import Volume | |
| v = Volume(type="zarr", path="https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/9.366um-1.2m-113keV-volume-20250821151531.zarr/0") # one pyramid level | |
| block = v[0:64, 2800:2864, 2900:2964]</code></pre></div></details> | |
| <details><summary>curl<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/9.366um-1.2m-113keV-volume-20250821151531.zarr/.zattrs # OME multiscales metadata | |
| curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/9.366um-1.2m-113keV-volume-20250821151531.zarr/0/.zarray # one level: shape, chunks, dtype, codec</code></pre></div></details> | |
| </div> | |
| <div class="scc-src" id="connect-segment"><h3>Its surface (tifxyz)</h3> | |
| <p class="scc-meta">CC BY-NC 4.0 (Vesuvius Challenge open data)</p> | |
| <div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/mesh/20260220213127-on-20250821151531-9.366um.tifxyz</code></pre></div> | |
| <details><summary>Python (numpy, tifffile)<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install numpy tifffile | |
| import io, json, urllib.request | |
| import numpy as np, tifffile | |
| T = "https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/mesh/20260220213127-on-20250821151531-9.366um.tifxyz" | |
| meta = json.load(urllib.request.urlopen(T + "/meta.json")) # scale, bbox, format | |
| get = lambda c: tifffile.imread(io.BytesIO(urllib.request.urlopen(f"{T}/{c}.tif").read())) | |
| xyz = np.stack([get(c) for c in "xyz"], -1) # xyz[i, j] = (x, y, z) in scan voxels; -1 = no surface</code></pre></div></details> | |
| </div> | |
| <div class="scc-src" id="connect-layers24"><h3>The same segment's 2.4 um surface volume (what every model reads in Compare models)</h3> | |
| <p class="scc-meta">CC BY-NC 4.0 (Vesuvius Challenge open data) 路 <a href="https://scrollprize.org/data_browser/PHerc0841" target="_blank" rel="noopener">browse</a></p> | |
| <div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/2.403um-0.22m-77keV-volume-20260319124803.zarr</code></pre></div> | |
| <details><summary>Python (zarr)<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "zarr>=3" fsspec aiohttp | |
| import zarr | |
| root = zarr.open_group("https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/2.403um-0.22m-77keV-volume-20260319124803.zarr", mode="r") # OME-Zarr, zarr v2 | |
| a = root["0"] # level 0 is full resolution; level L is 2**L times coarser | |
| print(a.shape, a.dtype, a.chunks) | |
| block = a[0:64, 11200:11264, 11600:11664] # (z, y, x); reads only the chunks it touches</code></pre></div></details> | |
| <details><summary>villa's vesuvius package<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "vesuvius[volume-only]" | |
| from vesuvius import Volume | |
| v = Volume(type="zarr", path="https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/2.403um-0.22m-77keV-volume-20260319124803.zarr/0") # one pyramid level | |
| block = v[0:64, 11200:11264, 11600:11664]</code></pre></div></details> | |
| <details><summary>curl<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/2.403um-0.22m-77keV-volume-20260319124803.zarr/.zattrs # OME multiscales metadata | |
| curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/surface-volumes/2.403um-0.22m-77keV-volume-20260319124803.zarr/0/.zarray # one level: shape, chunks, dtype, codec</code></pre></div></details> | |
| </div> | |
| <div class="scc-src" id="connect-segment24"><h3>Its 2.4 um surface (tifxyz), the mesh the 3D models are read onto</h3> | |
| <p class="scc-meta">CC BY-NC 4.0 (Vesuvius Challenge open data)</p> | |
| <div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/mesh/20260220213127-on-20260319124803-2.403um.tifxyz</code></pre></div> | |
| <details><summary>Python (numpy, tifffile)<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install numpy tifffile | |
| import io, json, urllib.request | |
| import numpy as np, tifffile | |
| T = "https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0841/segments/20260220213127-w00/mesh/20260220213127-on-20260319124803-2.403um.tifxyz" | |
| meta = json.load(urllib.request.urlopen(T + "/meta.json")) # scale, bbox, format | |
| get = lambda c: tifffile.imread(io.BytesIO(urllib.request.urlopen(f"{T}/{c}.tif").read())) | |
| xyz = np.stack([get(c) for c in "xyz"], -1) # xyz[i, j] = (x, y, z) in scan voxels; -1 = no surface</code></pre></div></details> | |
| </div> | |
| <div class="scc-src" id="connect-api"><h3>Call Ink Lens from code or an agent</h3> | |
| <p class="scc-meta">Code Apache 2.0; models MIT (each credited in list_models); scans CC BY-NC 4.0 路 Checked live on 24 Oct 2026: /list_samples and /lens_sample answered (gradio_client, the 0841-w00 sample). Model output, not a reading.</p> | |
| <div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://huggingface.co/spaces/SharpMeow/ink-lens</code></pre></div> | |
| <details><summary>Python /lens_sample<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client | |
| from gradio_client import Client | |
| client = Client("SharpMeow/ink-lens") | |
| result = client.predict(sample_id="0841-w00", size=640, reader="d9v2", windows=3, api_name="/lens_sample")</code></pre></div></details> | |
| <details><summary>Python /list_samples<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client | |
| from gradio_client import Client | |
| client = Client("SharpMeow/ink-lens") | |
| result = client.predict(api_name="/list_samples")</code></pre></div></details> | |
| <details><summary>Python /compare_sample<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client | |
| from gradio_client import Client | |
| client = Client("SharpMeow/ink-lens") | |
| result = client.predict(sample_id="0841-w00", models="ink_9um-s42,reader-v3,hecate-9.6", size=384, scan="2.4", centers="0", steps="1", api_name="/compare_sample")</code></pre></div></details> | |
| <details><summary>Python /list_models<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client | |
| from gradio_client import Client | |
| client = Client("SharpMeow/ink-lens") | |
| result = client.predict(api_name="/list_models")</code></pre></div></details> | |
| <details><summary>curl /lens_sample<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>URL=https://sharpmeow-ink-lens.hf.space | |
| EVENT=$(curl -s -X POST $URL/gradio_api/call/lens_sample -H 'Content-Type: application/json' \ | |
| -d '{"data": ["0841-w00", 640, "d9v2", 3]}' | python3 -c 'import json,sys; print(json.load(sys.stdin)["event_id"])') | |
| curl -sN $URL/gradio_api/call/lens_sample/$EVENT</code></pre></div></details> | |
| <details><summary>MCP (Claude, Cursor and other agents)<span class="scc-b ok">tested 2026-10-24</span></summary> | |
| <div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>{ | |
| "mcpServers": { | |
| "ink-lens": { | |
| "url": "https://sharpmeow-ink-lens.hf.space/gradio_api/mcp/sse" | |
| } | |
| } | |
| } | |
| Tool list: https://sharpmeow-ink-lens.hf.space/gradio_api/mcp/schema</code></pre></div></details> | |
| </div> | |
| <footer>Machine-readable: <a href="https://huggingface.co/spaces/SharpMeow/ink-lens/blob/main/connect.json" target="_blank" rel="noopener">connect.json</a> and <a href="https://huggingface.co/spaces/SharpMeow/ink-lens/blob/main/CONNECT.md" target="_blank" rel="noopener">CONNECT.md</a>. Checked 2026-10-24. "Tested" means the snippet ran against this public data on that date. Scan data keeps its own license (the Vesuvius Challenge open data is CC BY-NC 4.0).</footer></section> | |