zhreshold closed pull request #9480: Prep script and Fixes for single shot 
detector (SSD)
URL: https://github.com/apache/incubator-mxnet/pull/9480
 
 
   

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/ssd/data/demo/download_demo_images.py 
b/example/ssd/data/demo/download_demo_images.py
index 554ba7e4e1..425f71393c 100755
--- a/example/ssd/data/demo/download_demo_images.py
+++ b/example/ssd/data/demo/download_demo_images.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
diff --git a/example/ssd/dataset/testdb.py b/example/ssd/dataset/testdb.py
index 9a4b985d8e..2f982a4b30 100644
--- a/example/ssd/dataset/testdb.py
+++ b/example/ssd/dataset/testdb.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import os
-from imdb import Imdb
+from .imdb import Imdb
 
 
 class TestDB(Imdb):
diff --git a/example/ssd/demo.py b/example/ssd/demo.py
old mode 100644
new mode 100755
index 8106eb553a..0480bdd658
--- a/example/ssd/demo.py
+++ b/example/ssd/demo.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
diff --git a/example/ssd/init.sh b/example/ssd/init.sh
new file mode 100755
index 0000000000..53104bb7d7
--- /dev/null
+++ b/example/ssd/init.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#
+# Train SSD with Pascal VOC
+#
+set -e
+set -x
+
+
+function download_pascal_voc() {
+    pushd .
+    cd data
+    wget -c --show-progress 
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
+    wget -c --show-progress 
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
+    wget -c --show-progress 
http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
+    tar -xvf VOCtrainval_11-May-2012.tar
+    tar -xvf VOCtrainval_06-Nov-2007.tar
+    tar -xvf VOCtest_06-Nov-2007.tar
+    popd
+}
+
+function download_model() {
+    pushd .
+    
MODELFILEURL="https://github.com/zhreshold/mxnet-ssd/releases/download/v0.6/resnet50_ssd_512_voc0712_trainval.zip";
+    MODELFILE="resnet50_ssd_512_voc0712_trainval.zip"
+    cd model
+    wget -c $MODELFILEURL
+    unzip $MODELFILE
+    popd
+}
+
+function download_demo_images() {
+    pushd .
+    cd data/demo
+    ./download_demo_images.py
+    popd
+}
+
+download_pascal_voc
+download_model
+download_demo_images
diff --git a/src/operator/contrib/multibox_detection.cu 
b/src/operator/contrib/multibox_detection.cu
index 6db8c55597..98151f8b87 100644
--- a/src/operator/contrib/multibox_detection.cu
+++ b/src/operator/contrib/multibox_detection.cu
@@ -51,7 +51,9 @@ __device__ void CalculateOverlap(const DType *a, const DType 
*b, DType *iou) {
 }
 
 template<typename DType>
-__global__ void DetectionForwardKernel(DType *out, const DType *cls_prob,
+__global__
+__launch_bounds__(cuda::kMaxThreadsPerBlock)
+void DetectionForwardKernel(DType *out, const DType *cls_prob,
                                        const DType *loc_pred, const DType 
*anchors,
                                        DType *temp_space, const int 
num_classes,
                                        const int num_anchors, const float 
threshold,


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to