--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/a8daeec7-ce24-46ec-a75d-dd31c728a637%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/d88aeafb-cac0-4b13-b072-0fa26d56f618%40googlegroups.com.
layer { name: "prob" type: "SoftmaxWithLoss" bottom: "score" bottom: "label" top: "loss" loss_param { ignore_label: 255 normalize: false } }since void is coded as value 255. The loss is not computed at these pixels.
Hi, shelhamer, I did what you have suggested, and don't get the reported mIU on pascal voc 2011 seg val data. The reported mIU is 64.0, and I get about 72, there must be something wrong with my code, but I don't know where. I searched for many concepts, like the mIU metric, but still in fusion.
Below is the code for testing, can you help see it and give me some possible suggestion.
net = caffe.Net("deploy.prototxt", "fcn-32s-pascal.caffemodel", caffe.TEST)files = []with open("val.txt","r") as f:for line in f.readlines():line = line.strip("\n")files.append(line)f.close()colors = []with open("color.txt", "r") as cf:for line in cf.readlines():line = line.strip("\n")tmp = line.split()colors.append((int(tmp[3]), int(tmp[2]), int(tmp[1])) )cf.close()bound = (192,224,224)sum = 0.ct=0 # counterfor l in files:ct += 1print ct, limg = cv2.imread("data/images/%s.jpg"%(str(l)))in_ = np.array(img, dtype=np.float32)in_ -= np.array((104.00698793,116.66876762,122.67891434))in_ = in_.transpose((2,0,1))net.blobs['data'].reshape(1, *in_.shape)net.blobs['data'].data[...] = in_net.forward()out = net.blobs['upscore'].data[0].argmax(axis=0)mask = cv2.imread("data/mask/%s.png"%(l))label = np.zeros(mask[:,:,0].shape)obj = []value = 0.num = 0for i in range(len(colors)):eq = np.equal(mask, colors[i])eq = np.prod(eq, 2).astype(int)if (eq > 0).any():num += 1label += ( i+1 ) * eqobj.append(i+1)if num == 0:raiseeq = np.equal(mask, bound)eq = np.prod(eq, 2).astype(int)label[np.nonzero(eq > 0)] = 255out[np.nonzero(eq > 0)] = 255# including backgroundif(label == 0).any():obj.append(0)num += 1for idx in obj:count1 = np.count_nonzero( (out == idx) & (label == idx))count2 = np.count_nonzero( (out == idx) | (label==idx))print count1, count2value += float(count1)/count2value = value/numsum += valueprint 1111, sum/1111
--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users+unsubscribe@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/b23b84da-d05d-44d8-ba19-f88f59a115e2%40googlegroups.com.
To train an FCN with the softmax loss all you need to do is turn your annotation into a 1 x H x W array of class indices from {0, 1, ..., K - 1} for K classes. This is done for annotations stored in png in this example from fcn.berkeleyvision.org: https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/voc_layers.py#L108-L116The data can be stored however you like, as long as you can transform it into such an array.
Evan Shelhamer
On Tue, Mar 28, 2017 at 8:04 AM, <zhe...@gmail.com> wrote:
Hi:Can U tell me how to make the lable image(ground truth) in FCN? What tools or procedures?Thanks,very much.
在 2017年3月26日星期日 UTC+8下午7:38:33,Mateo写道:Hi, I'm new in caffe. I want to fine-tune my own dataset with any of the voc-fcns. My images are in gray-scale , in bmp format.I only have 1 class (2 classes , if we include the ground) . Should I convert them to .jpg ? It is necessary to store the segmentation ground truth image in png format? Or can I create them in bmp ? Because when I stored them in .png format, with the opencv library, the images loss quality.
Thank you for your answers,Mateo
On Thursday, July 9, 2015 at 4:35:00 AM UTC+2, Ben wrote:Hi, anyone can tell me how to create the ground truth label mask for implementing fully convolution networks?In pascal voc dataset, the segmentation data has been annotated with different color for different class of object.But how can I know which color represent which class ?
--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.