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.0.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.0-py3-none-any.whl (54.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hed_tensor-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8e1bfbe59473bdf19cdf4b12def1fa1847d2cf414ec491a59b348e159f6d1024
MD5 bd015a178a11d3e64ff41ad06894675f
BLAKE2b-256 fa402b21a701ca353589d580e670b5123999673539330450965917a3be3401cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hed_tensor-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7838407a00b9d4e73965bd60ad4ae48bd5d82005615900d553fb36c31cdef9b
MD5 60aca890c1b5ab8d77679811af5487be
BLAKE2b-256 98b1a6494d79289b3d601648ed0294da35a6465b9273d85d2d07c199a6d3999e

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