A python implementation of edge eval.
The logic of the code is almost the same as that of the origin MATLAB implementation (see References).
- Python3
- Numpy
- Scipy >= 1.6.0
- g++
- Matplotlib
git clone https://github.com/Walstruzz/edge_eval_python.git
cd edge_eval_python
Most of the code in this folder is copied from davidstutz/extended-berkeley-segmentation-benchmark.
Actually, there is a more efficient function in Scipy
that can solve the CSA problem without compiling the following cxx codes...
cd cxx/src
source build.sh
from scipy.io import savemat
key = "result"
result = your_method(image)
savemat(save_name, {key: image})
python main.py --alg "HED" --model_name_list "hed" --result_dir examples/hed_result \
--save_dir examples/hed_eval_result --gt_dir examples/bsds500_gt --key result \
--file_format .mat --workers -1
ODS | OIS | AP | R50 |
---|---|---|---|
0.789 | 0.806 | 0.810 | 0.897 |
- Because of the difference in calculation precision and the sensitivity of NMS threshold, the edge images may be slightly different.
match_edge_maps
samples points randomly (so as Matlab).- Python and Matlab index files in different order, resulting in different order of
eval_bdry_img.txt
. - Python version is slower than Matlab version. Should I implement more functions in
cxx/lib/solve_cas.so
?