d8627f9057fd69b48c758be5468480a3bb04b81e,examples/segnet/calc_weight.py,,,#,8
Before Change
dataset = CamVidDataset(split="train")
n_cls_pixels = [0 for _ in range(n_class)]
n_img_pixels = [0 for _ in range(n_class)]
for img, lbl in dataset:
for cls_i in np.unique(lbl):
n_cls_pixels[cls_i] += np.sum(lbl == cls_i)
n_img_pixels[cls_i] += lbl.size
freq = []
for n_cls_pixel, n_img_pixel in zip(n_cls_pixels, n_img_pixels):
freq.append(n_cls_pixel / n_img_pixel)
freq = np.array(freq)
median_freq = np.median(freq)
After Change
dataset = CamVidDataset(split="train")
n_cls_pixels = np.zeros((n_class,))
n_img_pixels = np.zeros((n_class,))
for img, label in dataset:
for cls_i in np.unique(label):
n_cls_pixels[cls_i] += np.sum(label == cls_i)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: chainer/chainercv
Commit Name: d8627f9057fd69b48c758be5468480a3bb04b81e
Time: 2017-05-28
Author: yuyuniitani@gmail.com
File Name: examples/segnet/calc_weight.py
Class Name:
Method Name:
Project Name: matplotlib/matplotlib
Commit Name: 3f59cdec57976ba0564887850541c0bd974c1e10
Time: 2019-01-19
Author: anntzer.lee@gmail.com
File Name: lib/mpl_toolkits/mplot3d/art3d.py
Class Name:
Method Name: zalpha
Project Name: azavea/raster-vision
Commit Name: 3676970a96bd66646b4cf40991e319e34154bc97
Time: 2019-05-29
Author: lewfish@gmail.com
File Name: rastervision/evaluation/semantic_segmentation_evaluation.py
Class Name: SemanticSegmentationEvaluation
Method Name: compute