Skip to main content

Holistic Edge Detection (HED) model for TensorFlow/Keras with bundled pretrained weights

Project description

HED-Tensor: Holistic Edge Detection

A TensorFlow/Keras implementation of Holistically-Nested Edge Detection (HED) with pretrained weights included. Use it as easily as VGG16 or ResNet!

🚀 Quick Start

Installation

pip install hed-tensor

Usage (3 lines!)

from hed_tensor import HED, detect_edges

model = HED()  # Weights automatically load!
edges = detect_edges('your_image.jpg', model=model)

That's it! No need to download weights separately. 🎉

📦 Features

Pretrained weights included - No extra downloads needed
Simple API - Just like using VGG16 or ResNet
Multiple input formats - Works with file paths, PIL Images, or NumPy arrays
Batch processing - Process multiple images efficiently
TensorFlow 2.x - Modern and fast

🎯 Examples

Basic Usage

from hed_tensor import HED, detect_edges
from PIL import Image

# Load model (weights auto-load)
model = HED()

# Detect edges
edges = detect_edges('image.jpg', model=model)

# Save result
Image.fromarray(edges).save('edges.png')

Using NumPy arrays

import numpy as np
from hed_tensor import HED, detect_edges

model = HED()
image_array = np.array(Image.open('image.jpg'))
edges = detect_edges(image_array, model=model)

Batch Processing

from hed_tensor import batch_detect_edges, HED

model = HED()
image_paths = ['img1.jpg', 'img2.jpg', 'img3.jpg']

edge_maps = batch_detect_edges(
    image_paths, 
    model=model, 
    output_dir='output_edges'
)

Load Custom Weights

# Use your own trained weights
model = HED(weights='path/to/your/checkpoint.h5')

# Or skip loading weights
model = HED(weights=None)

📋 Requirements

  • Python >= 3.7
  • TensorFlow >= 2.4.0
  • NumPy >= 1.19.0
  • Pillow >= 8.0.0

🎓 Citation

If you use this package in your research, please cite the original HED paper:

@inproceedings{xie2015holistically,
  title={Holistically-nested edge detection},
  author={Xie, Saining and Tu, Zhuowen},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},
  pages={1395--1403},
  year={2015}
}

📄 License

MIT License

👨‍💻 Author

Mohammad Saad Nathani
📧 saadnathani2005@gmail.com

🤝 Contributing

Contributions are welcome!


Made with ❤️ for the Computer Vision community

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

hed_tensor-1.0.1.tar.gz (54.7 MB view details)

Uploaded Source

Built Distribution

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

hed_tensor-1.0.1-py3-none-any.whl (54.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hed_tensor-1.0.1.tar.gz
  • Upload date:
  • Size: 54.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for hed_tensor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c65344372b17a23bd7db1d4bd2b311bf60c489d04a8fc33b4790070466d74553
MD5 5d7f6150574c8f5b5417840cdc1655ef
BLAKE2b-256 751f49e01c4fa9cc0431546d5bf7a2d0104d6173941ab2fca3e6c6023ab0d1ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hed_tensor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 54.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for hed_tensor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73537777d814695e929348a7a5732ca90ff32d32bf88e68e1c848befdec4b66d
MD5 1db4ba2e8e27d903b80484591a1e94cc
BLAKE2b-256 af57127d3ceb099e90937ee43ca96aa94290ccede62792aa13bf36ea53dd657c

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