-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
Very nice work! At long last, Unpooling is reimplemented in MXNet. Segnet and U-Net are both famous in Kaggle and many practical applications rather than FCN-xs and Deeplab so I think MXNet need this work. |
Does result match original paper? @zhreshold Could you have a look? |
Nice, can you put some instruction of how to use your operators? @solin319 |
Build MXNet with new pooling and upsampling operators.
|
|
||
mx.metric.check_label_shapes(label, pred_label) | ||
|
||
self.sum_metric += (pred_label.flat == label.flat).sum() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If ignore_label is in pred_label, e.g. ignore_label == 0, this is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elf.sum_metric -= len(pred_label[pred_label == self.ignore_label])
This can solve the problem caused by ignore_label located in pred_label.
output_names=output_names, label_names=label_names) | ||
self.eps = eps | ||
|
||
def update(self, labels, preds): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the native one in metric.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.The native 'CorssEntropy' in metric.py can only used to pred_label with 2-d.
2. In this example, the pred_label is 4-d and the softmax result located in axis 1. We must swap the softmax result to the last axis.
3. Because of the ignore_label=11, the max number of label is 11, but the size of softmax result is only 0-10. We must add one column data to use the command
prob = pred[numpy.arange(label.shape[0]), numpy.int64(label)]
example/segnet/data_iter.py
Outdated
return list(data.items()), list(label.items()) | ||
|
||
def _read_img(self, img_name, label_name): | ||
img = Image.open(os.path.join(self.root_dir, img_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use mx.image.imread instead of PIL package.
|
||
DMLC_REGISTER_PARAMETER(PoolingMaskParam); | ||
|
||
MXNET_REGISTER_OP_PROPERTY(PoolingMask, PoolingMaskProp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this operator is reusable to be put into operator/contrib?
|
||
DMLC_REGISTER_PARAMETER(UpSamplingMaskParam); | ||
|
||
MXNET_REGISTER_OP_PROPERTY(UpSamplingMask, UpSamplingMaskProp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this operator is reusable to be put into operator/contrib?
import logging | ||
import pdb | ||
import numpy as np | ||
from PIL import Image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, use mx.image
import os | ||
import logging | ||
import numpy as np | ||
from PIL import Image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
Remove result pngs, you can use github issue to upload images and get permanent links.
@zhreshold
|
@solin319 |
@zhreshold |
@solin319 Have you finished? Can you rebase to fix the CI? |
2c42c9a
to
0bee468
Compare
Result on the official site is:
Which one are you comparing to? |
The first one segnet-basic, training with 367 pics and test in 233 pics. |
@zhreshold @winstywang @solin319 Any updates on this? |
@zhreshold Could you check if this reproduces the paper? |
@solin319 Is this table SOTA as you are results are comparing with? |
comparing with:
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html |
Hi, the community has passed to vote about associating the code changes with JIRA (https://lists.apache.org/thread.html/ab22cf0e35f1bce2c3bf3bec2bc5b85a9583a3fe7fd56ba1bbade55f@%3Cdev.mxnet.apache.org%3E) We have updated the guidelines for contributors in https://cwiki.apache.org/confluence/display/MXNET/Development+Process, please ensure that you have created a JIRA at https://issues.apache.org/jira/projects/MXNET/issues/ to describe your work in this pull request and include the JIRA title in your PR as [MXNET-xxxx] your title where MXNET-xxxx is the JIRA id Thanks! |
Re-implement segnet in MXnet.
Details in https://github.com/solin319/incubator-mxnet/tree/solin-patch-segnet/example/segnet
The Camvid test accuracy achieved 83% in segnet_basic network.
Does MXNet need this work?