You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/09 00:24:48 UTC

[GitHub] nswamy closed pull request #11982: [MXNET-696] Fix undefined variable errors

nswamy closed pull request #11982: [MXNET-696] Fix undefined variable errors
URL: https://github.com/apache/incubator-mxnet/pull/11982
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/example/fcn-xs/image_segmentaion.py b/example/fcn-xs/image_segmentaion.py
index 75df2d128a2..562db14d36b 100644
--- a/example/fcn-xs/image_segmentaion.py
+++ b/example/fcn-xs/image_segmentaion.py
@@ -93,8 +93,8 @@ def main():
     model_prefix = "FCN8s_VGG16"
     epoch = 19
 
-    # By default, MXNet will run on the CPU. Uncomment the line below to execute on the GPU
-    # ctx = mx.gpu()
+    # By default, MXNet will run on the CPU. Change to ctx = mx.gpu() to run on GPU.
+    ctx = mx.cpu()
 
     fcnxs, fcnxs_args, fcnxs_auxs = mx.model.load_checkpoint(model_prefix, epoch)
     fcnxs_args["data"] = mx.nd.array(get_data(args.input), ctx)
diff --git a/example/ssd/dataset/pycocotools/coco.py b/example/ssd/dataset/pycocotools/coco.py
index 19a7b8b7f64..470f086f0b0 100755
--- a/example/ssd/dataset/pycocotools/coco.py
+++ b/example/ssd/dataset/pycocotools/coco.py
@@ -255,22 +255,7 @@ def showAnns(self, anns):
                             color.append(c)
                     else:
                         # mask
-                        t = self.imgs[ann['image_id']]
-                        if type(ann['segmentation']['counts']) == list:
-                            # rle = maskUtils.frPyObjects([ann['segmentation']], t['height'], t['width'])
-                            raise NotImplementedError("maskUtils disabled!")
-                        else:
-                            rle = [ann['segmentation']]
-                        # m = maskUtils.decode(rle)
                         raise NotImplementedError("maskUtils disabled!")
-                        img = np.ones( (m.shape[0], m.shape[1], 3) )
-                        if ann['iscrowd'] == 1:
-                            color_mask = np.array([2.0,166.0,101.0])/255
-                        if ann['iscrowd'] == 0:
-                            color_mask = np.random.random((1, 3)).tolist()[0]
-                        for i in range(3):
-                            img[:,:,i] = color_mask[i]
-                        ax.imshow(np.dstack( (img, m*0.5) ))
                 if 'keypoints' in ann and type(ann['keypoints']) == list:
                     # turn skeleton into zero-based index
                     sks = np.array(self.loadCats(ann['category_id'])[0]['skeleton'])-1
@@ -430,6 +415,4 @@ def annToMask(self, ann):
         :return: binary mask (numpy 2D array)
         """
         rle = self.annToRLE(ann)
-        # m = maskUtils.decode(rle)
         raise NotImplementedError("maskUtils disabled!")
-        return m
diff --git a/example/ssd/symbol/common.py b/example/ssd/symbol/common.py
index 4a0458f8728..a2fb4e69d18 100644
--- a/example/ssd/symbol/common.py
+++ b/example/ssd/symbol/common.py
@@ -206,6 +206,9 @@ def multibox_layer(from_layers, num_classes, sizes=[.2, .95],
          assert sizes[0] > 0 and sizes[0] < 1
          assert sizes[1] > 0 and sizes[1] < 1 and sizes[1] > sizes[0]
          tmp = np.linspace(sizes[0], sizes[1], num=(len(from_layers)-1))
+         # Ref for start_offset value:
+         # https://arxiv.org/abs/1512.02325
+         start_offset = 0.1
          min_sizes = [start_offset] + tmp.tolist()
          max_sizes = tmp.tolist() + [tmp[-1]+start_offset]
          sizes = zip(min_sizes, max_sizes)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services