Skip to main content

A simple Canny edge detector for pytorch

Project description

Canny Edges

img1_in img2_in img3_in
img1_out img2_out img3_out

A simple Torch.nn.Module to return an image mask representing edges found by the Canny Edge-Finding algorithm.

Supports:

  • PyTorch Tensor images formatted in image batches [B, C, h, w], with float32 data, and values spanning [0,1]
  • any number of channels C
  • TorchScript jit script, as well as the newer, traced torch-export, on the Canny nn.Module class

Usage

I use mise to handle project tools. Install it if you don't have it

git clone https://github.com/chrishenn/canny.git
cd canny
mise i

# list available just recipes
just --list

Available recipes:
    interactive # Detect and display canny edges on a set of test images. Use ctrl+c to kill
    lint        # run project formatters/linters [alias: l]
    test        # run basic tests
    unsafe      # run ruff with unsafe-fixes

Dev

# build distrobution pkgs locally
uv build --package canny_chenn

# push tag to trigger pypi to build pkgs and publish to pypi
git tag -a v1.0.0 -m v1.0.0 -f && git push --tags -f

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canny_chenn-1.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canny_chenn-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file canny_chenn-1.0.1.tar.gz.

File metadata

  • Download URL: canny_chenn-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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}

File hashes

Hashes for canny_chenn-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0aee6701e1d2fae4b77707df7d79adf0305826c3e44f6f56e5a0f8f25733cbe5
MD5 810fa579a73cc5f0b9824d92a9578512
BLAKE2b-256 ba1d2ae0c07e1e4ecc47ac6919ca595747fbe60312a6d7ab7b066f9dffc1a4f5

See more details on using hashes here.

File details

Details for the file canny_chenn-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: canny_chenn-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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}

File hashes

Hashes for canny_chenn-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba30ee159f66e5a791ed9c9114c03688dee3eb6b21ebc727ebd10e48ac2079d9
MD5 4fd4abe7faa6d849657c8a32611c7285
BLAKE2b-256 14e710558374fae3644f841a9e64d3d6b7167f5fc2360a6f303ef679620b0fd5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page