xwjabc / hed

A PyTorch reimplementation of Holistically-Nested Edge Detection
170 stars 42 forks source link

How can i get the new statistics number in the 'datasets.py' file for new dataset #15

Open tqwhdx19 opened 5 years ago

tqwhdx19 commented 5 years ago

In the datasets.py file, the original code is like this: image = image - np.array((104.00698793, # Minus statistics. 116.66876762, 122.67891434)) but How can i get the new statistics number for my own dataset?

xwjabc commented 5 years ago

For (104.00698793, 116.66876762, 122.67891434), it comes from the Caffe version of HED. According to this link, the values are calculated by using the mean of ImageNet dataset in BGR format. You can use a similar way to calculate the statistics of your dataset.