Skip to content

Commit

Permalink
Revert "apache#13624 clojure nightly tests (apache#13624)"
Browse files Browse the repository at this point in the history
This reverts commit eebdd5f.
  • Loading branch information
piyushghai committed Jan 22, 2019
1 parent 4c88f30 commit 4e33e33
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 61 deletions.
8 changes: 0 additions & 8 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -868,14 +868,6 @@ unittest_ubuntu_cpu_clojure() {
./contrib/clojure-package/ci-test.sh
}

unittest_ubuntu_cpu_clojure_integration() {
set -ex
make scalapkg USE_OPENCV=1 USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
make scalainstall USE_OPENCV=1 USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
./contrib/clojure-package/integration-tests.sh
}


unittest_ubuntu_cpugpu_perl() {
set -ex
./perl-package/test.sh
Expand Down
13 changes: 0 additions & 13 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -887,19 +887,6 @@ def test_unix_clojure_cpu() {
}]
}

def test_unix_clojure_integration_cpu() {
return ['Clojure: CPU Integration': {
node(NODE_LINUX_CPU) {
ws('workspace/ut-clojure-integration-cpu') {
timeout(time: max_time, unit: 'MINUTES') {
utils.unpack_and_init('cpu', mx_lib, true)
utils.docker_run('ubuntu_cpu', 'unittest_ubuntu_cpu_clojure_integration', false)
}
}
}
}]
}

def test_unix_r_cpu() {
return ['R: CPU': {
node(NODE_LINUX_CPU) {
Expand Down
1 change: 0 additions & 1 deletion ci/jenkins/Jenkinsfile_unix_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ core_logic: {
custom_steps.test_unix_scala_cpu(),
custom_steps.test_unix_scala_mkldnn_cpu(),
custom_steps.test_unix_clojure_cpu(),
custom_steps.test_unix_clojure_integration_cpu(),
custom_steps.test_unix_perl_cpu(),
custom_steps.test_unix_r_cpu(),
custom_steps.test_unix_julia07_cpu(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
image-file-batches (->> input-dir
io/file
file-seq
sort
reverse
(filter #(.isFile %))
(filter #(re-matches #".*\.jpg$" (.getPath %)))
(mapv #(.getPath %))
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -78,44 +78,32 @@

(defn detect-single-image
"Detect objects in a single image and print top-5 predictions"
([detector input-dir] (detect-single-image detector input-dir "results"))
([detector input-image output-dir]
(.mkdir (io/file output-dir))
[detector input-image output-dir]
(let [image (infer/load-image-from-file input-image)
topk 5
res (infer/detect-objects detector image topk)
]
topk 5]
(process-results
[input-image]
res
output-dir)
(first res)
)))
(infer/detect-objects detector image topk)
output-dir)))

(defn detect-images-in-dir
"Detect objects in all jpg images in the directory"
([detector input-dir] (detect-images-in-dir detector input-dir "results"))
([detector input-dir output-dir]
(.mkdir (io/file output-dir))
[detector input-dir output-dir]
(let [batch-size 20
image-file-batches (->> input-dir
io/file
file-seq
sort
(filter #(.isFile %))
(filter #(re-matches #".*\.jpg$" (.getPath %)))
(mapv #(.getPath %))
(partition-all batch-size))]
(apply concat
(doall
(for [image-files image-file-batches]
(let [image-batch (infer/load-image-paths image-files)
topk 5
res (infer/detect-objects-batch detector image-batch topk) ]
(let [image-batch (infer/load-image-paths image-files) topk 5]
(process-results
image-files
res
output-dir)
res))))))
(infer/detect-objects-batch detector image-batch topk)
output-dir))))))

(defn run-detector
"Runs an image detector based on options provided"
Expand All @@ -131,7 +119,7 @@
detector (infer/create-object-detector
factory
{:contexts [(context/default-context)]})]
(println "Output results to:" output-dir ":")
(println "Output results to:" output-dir ":" (.mkdir (io/file output-dir)))
(println "Object detection on a single image")
(detect-single-image detector input-image output-dir)
(println "Object detection on images in a directory")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
(let [detector (create-detector)
predictions (detect-single-image detector image-file)
{:keys [class prob x-min x-max y-min y-max] :as pred} (first predictions)]
(clojure.pprint/pprint predictions)
(is (some? predictions))
(is (= 5 (count predictions)))
(is (string? class))
Expand All @@ -56,13 +55,11 @@
(deftest test-batch-detection
(let [detector (create-detector)
batch-predictions (detect-images-in-dir detector image-dir)
_ (clojure.pprint/pprint batch-predictions)
predictions (first batch-predictions)
{:keys [class prob x-min x-max y-min y-max] :as pred} (first predictions)]
(is (some? batch-predictions))
(is (= 5 (count predictions)))
(is (string? class))
(is (< 0.8 prob))
(println [x-min x-max y-min y-max])
(every? #(< 0 % 1) [x-min x-max y-min y-max])
(is (= #{"dog" "person"} (set (mapv :class predictions))))))
(is (= #{"dog" "person" "bicycle" "car"} (set (mapv :class predictions))))))
18 changes: 7 additions & 11 deletions contrib/clojure-package/integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

set -evx

MXNET_HOME=${PWD}
cd ${MXNET_HOME}/contrib/clojure-package
# first build the package and install it
lein install

# then run through the examples
MXNET_HOME=$(cd "$(dirname $0)/../.."; pwd)
EXAMPLES_HOME=${MXNET_HOME}/contrib/clojure-package/examples
# use AWK pattern for blacklisting
TEST_CASES=`find ${EXAMPLES_HOME} -name test | awk '!/dontselect1|dontselect2/'`
for i in $TEST_CASES ; do
cd ${i} && lein test
done
#cd ${MXNET_HOME}/contrib/clojure-package
#lein test
#lein cloverage --codecov
for test_dir in `find ${EXAMPLES_HOME} -name test` ; do
cd ${test_dir} && lein test
done

0 comments on commit 4e33e33

Please sign in to comment.