Holistically-Nested Edge Detection: pytorch-hed
¶
This is a reimplementation in the form of a python package of Holistically-Nested Edge Detection using PyTorch based on the previous pytorch implementation by sniklaus. If you would like to use of this work, please cite the paper accordingly. Also, make sure to adhere to the licensing terms of the authors. Moreover, if you will be making use of this particular implementation, please acknowledge it.
Usage¶
import torchHED
# process a single image file
torchHED.process_file("./images/sample.png", "./images/sample_processed.png")
# process all images in a folder
torchHED.process_folder("./input_folder", "./output_folder")
# process a PIL.Image loaded in memory and return a new PIL.Image
# img = PIL.Image.open("./images/sample.png")
img_hed = torchHED.process_img(img)
Input | Output |
---|---|
Documentation¶
-
torchHED.hed.
process_file
(input_fn: str, output_fn: str) → None[source]¶ Given an image file, applies HED to it and writes the output in another image
- Parameters
input_fn (str) – Input image filename
output_fn (str) – Output image filename