Skip to main content

JAX implementation of probabilistic_hough_line

This is a JAX implementation of the skimage.transform.probabilistic_hough_line function.

Installation

uv add hough-jax

or if you don't have uv:

pip install hough-jax

Usage

import jax
import jax.numpy as jnp
import numpy as np
from hough_jax import probabilistic_hough_line

# Create a simple image with a horizontal line
image = np.zeros((100, 100), dtype=np.float32)
image[50, 20:80] = 1.0

# Detect lines
lines, nlines = probabilistic_hough_line(
    jnp.array(image),
    threshold=10,
    line_length=30,
    line_gap=3,
    rng=jax.random.PRNGKey(0),
)

# lines: Array of shape (lines_max, 2, 2) with endpoints [[x0, y0], [x1, y1]]
# nlines: Number of valid lines detected
print(f"Detected {int(nlines)} line(s)")
print(f"First line endpoints: {lines[0]}")

Converting to skimage format

To get the same output format as skimage.transform.probabilistic_hough_line:

def to_skimage_format(lines, nlines):
    """Convert JAX output to list of ((x0, y0), (x1, y1)) tuples."""
    n = int(nlines)
    return [
        ((int(lines[i, 0, 0]), int(lines[i, 0, 1])), (int(lines[i, 1, 0]), int(lines[i, 1, 1])))
        for i in range(n)
    ]

skimage_lines = to_skimage_format(lines, nlines)
# [((79, 50), (20, 50))]

Metadata

Release files for hough-jax 0.2

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

Source distribution (sdist)

Source distribution for hough-jax 0.2
File Size Uploaded Provenance Actions
hough_jax-0.2.tar.gz 42.8 kB Without provenance Details for hough_jax-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hough-jax 0.2
File Interpreter ABI Platform Actions
hough_jax-0.2-py3-none-any.whl Python 3 none any Details for hough_jax-0.2-py3-none-any.whl

Total release size: 47.8 kB

Release files / hough_jax-0.2.tar.gz

Download URL hough_jax-0.2.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5d5c013c201ebff4f334046124f8378bcc10bbae194d17777365e1525e61fa82
BLAKE2b-256 checksum
How to use checksums
7a196a40e1b2a5d3513d5b1131fec6f00c35a1496bfac642fffc1db23019baf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / hough_jax-0.2-py3-none-any.whl

Download URL hough_jax-0.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d6738f191c52fc919cc10e09a4c3eec662820062393613466adc4ee0d7bc36f
BLAKE2b-256 checksum
How to use checksums
13679b242eb72e9529d76a5d56a09e199347086e7a4116bdbeb5e001010d53b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for hough-jax 0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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