Skip to main content

fibrs

A fast drop-in for avf-spline-generator 0.2.0, Qual's AFV fibre tracer (Qualzz/AVF_SPLINE_GENERATOR @ bee798f). Same flags, same .afv output.

  • fibrs predict runs Qual's AFV fibre model V2 on an NVIDIA GPU or an Apple silicon Mac, without PyTorch.
  • fibrs join joins a scroll's Z bands into one .afv.
  • fibrs strips runs villa's sheet-strip model over an AFV's fibres on an NVIDIA GPU, without PyTorch.

Fibre sets for whole scrolls, traced with fibrs: praveenperera/afv-v2-fibers.

Speed

CT to .afv on three 512-plane bands, one RTX 5090, fp32:

Pipeline Time
villa's prediction + original tracer about 35,000 s
fibrs 0.4.0 800 s

About 44× faster. A whole scroll takes fibrs an estimated 2.6–3 hours, against 80–140. Benchmarks.

Install

pip install fibrs
pip install "fibrs[predict]"   # adds cuDNN and cuBLAS for fibrs predict

Install into the environment that has numpy. fibrs uses numpy's OpenBLAS.

Standalone binaries are on the releases page, or:

cargo binstall fibrs
cargo install fibrs --locked

A standalone binary needs the numpy environment active, or FIBRS_LAPACK set. Install details.

Trace

fibrs --predictions P --array semantic --channel-order VH --tracing-predictions P \
  --tracing-array tracing --voxel-size-um 9.362 --storage compressed --threads 4 \
  --output fibers.afv --work-dir work

Or from Python: python -m fibrs ARGS.

  • Uses an NVIDIA GPU when available, otherwise the CPU. Force one with --device cpu or --device cuda.
  • Output is the same at any --threads.
  • Resume an interrupted run with --resume.
  • --tiles-yx NY NX traces a dense window as tiles, to use less memory.

To make an existing avf-spline-generator run fibrs:

scripts/install-dropin.sh VENV            # install
scripts/install-dropin.sh --restore VENV  # undo

Tracing details.

Join

fibrs join --manifest bands.json --output fibers-scroll.afv --stats fibers-scroll.json
{
  "bands": [
    {"afv": "trace/z08448-08960/fibers.afv", "core_z": [8448, 8960], "window_z": [8192, 9216]},
    {"afv": "trace/z08960-09472/fibers.afv", "core_z": [8960, 9472], "window_z": [8704, 9728]}
  ],
  "coordinate_space": "PHerc1545/20250821151648",
  "source_path": "https://vesuvius-challenge-open-data.s3.amazonaws.com/PHerc1545/volumes/....zarr",
  "provenance": {"operation": "halo_band_trace_join", "haloPlanes": 256}
}

core_z is the planes a band keeps, window_z the planes it was traced from.

Subset

# the fibres with a point in a box of native level-0 voxels: X0 X1 Y0 Y1 Z0 Z1
fibrs subset --input fibers-scroll.afv --output region.afv --box 2500 3524 3600 4624 8000 9024

# every fibre of 2.5 mm or more, the sheet-strip runner's default minimum
fibrs subset --input fibers-scroll.afv --output long.afv --min-length-mm 2.5

Writes a smaller .afv that villa's AFV importers read like the whole set. Fibres are kept whole and keep their ids, and the file keeps the set's uuid, so an imported fibre has the same UUID as in a whole-scroll import. --box, --min-length-mm and --family V|H combine: a fibre is kept only when it passes each one given. A box of a 27.6 GB scroll set takes about 20 s and under 1 GB of memory.

Predict

# whole array, matching villa's output
fibrs predict --mode villa --ct scroll.zarr/0 --model-dir afv_fiber_9um_v2 --out pred.zarr

# one z band, resumable
fibrs predict --ct scroll.zarr/0 --z0 12032 --z1 12544 --model-dir afv_fiber_9um_v2 --out band.zarr

Needs the model from Qualzz20/afv_fiber_9um_v2 and either Linux or Windows x86-64 with an RTX 30-series or newer GPU, cuDNN 9 and cuBLAS 12, or an Apple silicon Mac on macOS 26 or newer. Predict details.

Strips

fibrs strips run --afv PHerc0211_afv_v2.afv --out strips/PHerc0211 --weights fiber_strip_small_v1.safetensors \
  --ct s3://vesuvius-challenge-open-data/PHerc0211/volumes/20250821151803-9.362um-1.2m-113keV-masked.zarr \
  --cache-dir ctcache --umbilicus PHerc0211_umbilicus.json --voxel-size-um 9.362

Writes a sheet strip per fibre in the layout of villa's Python runner, about 8× faster on one RTX 5090 (2,095 decisions/s over the whole PHerc0211 scroll). The strips match PyTorch's on the error measures, and a run's output doesn't depend on its batch size or worker count. Needs Linux x86-64, an RTX 30-series or newer GPU, cuDNN 9, a weights export and a prefetched CT cache. Strips details.

Build

cargo build --release
FIBRS_LAPACK=/path/to/libscipy_openblas64_.so cargo test --release

Rust 1.100+.

Licence

Apache-2.0. See NOTICE and licenses/.

Metadata

Release files for fibrs 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fibrs 0.6.0
File Interpreter ABI Platform Actions
fibrs-0.6.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for fibrs-0.6.0-py3-none-win_amd64.whl
fibrs-0.6.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for fibrs-0.6.0-py3-none-manylinux_2_28_x86_64.whl
fibrs-0.6.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for fibrs-0.6.0-py3-none-macosx_11_0_arm64.whl

Total release size: 11.4 MB

Release files / fibrs-0.6.0-py3-none-win_amd64.whl

Download URL fibrs-0.6.0-py3-none-win_amd64.whl
Size 3.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
57e0efb248567f4884e32c27ab0bb4f53d64bb49abe276398db21fe5b904b952
BLAKE2b-256 checksum
How to use checksums
76ee2a45f9d68770707c9cf4e29a075c018e1e3b8d3e5c7e5d5e228dc43ea635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / fibrs-0.6.0-py3-none-manylinux_2_28_x86_64.whl

Download URL fibrs-0.6.0-py3-none-manylinux_2_28_x86_64.whl
Size 4.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
acc9fbf0ef0b023582ee39fa4afd4f33526cabdcdc919edbaef49cc7fb10201c
BLAKE2b-256 checksum
How to use checksums
8343c517280b37579cdb6490c7e02173fa7e8439d1108824c1b98d755e9c0f1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / fibrs-0.6.0-py3-none-macosx_11_0_arm64.whl

Download URL fibrs-0.6.0-py3-none-macosx_11_0_arm64.whl
Size 2.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9e8d028641bbfc71ceed1da251cc04b8412ac38eaaf327aeb2a5feb0462f9b16
BLAKE2b-256 checksum
How to use checksums
f913c52f57600ce7cc9f4227c8189acbd9db6dad24c18d9108c2263fa2a121fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for fibrs 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for fibrs-0.6.0-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page