-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Clojure] enhance draw bounding box #14567
[Clojure] enhance draw bounding box #14567
Conversation
… detection example. Adjust the specs and names to make it easier to run with object detection and clojure draw bounding box example
@hellonico and @Chouffe Would you mind taking a look and reviewing? |
Thank you for your contribution @gigasquid |
contrib/clojure-package/test/org/apache/clojure_mxnet/image_test.clj
Outdated
Show resolved
Hide resolved
(s/def ::ymin integer?) | ||
(s/def ::ymax integer?) | ||
(s/def ::coordinate (s/keys :req-un [::xmin ::xmax ::ymin ::ymax])) | ||
(s/def ::x-min number?) |
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.
Thanks for improving this!
contrib/clojure-package/examples/infer/objectdetector/src/infer/objectdetector_example.clj
Outdated
Show resolved
Hide resolved
contrib/clojure-package/examples/infer/objectdetector/src/infer/objectdetector_example.clj
Outdated
Show resolved
Hide resolved
contrib/clojure-package/examples/infer/objectdetector/src/infer/objectdetector_example.clj
Outdated
Show resolved
Hide resolved
contrib/clojure-package/test/org/apache/clojure_mxnet/image_test.clj
Outdated
Show resolved
Hide resolved
(is (= true (ImageIO/write new-img "png" (io/file tmp-dir "out.png")))))) | ||
(is (true? (ImageIO/write new-img "png" (io/file tmp-dir "out.png")))))) | ||
|
||
(deftest test-draw-bounding-box! |
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.
Thank you so much for adding this test!
@@ -22,7 +22,6 @@ | |||
:aliases {"run-detector" ["run" "--" "-m" "models/resnet50_ssd/resnet50_ssd_model" "-i" "images/dog.jpg" "-d" "images/"]} | |||
:dependencies [[org.clojure/clojure "1.9.0"] | |||
[org.clojure/tools.cli "0.4.1"] | |||
[origami "4.0.0-3"] |
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.
🎉
@@ -109,7 +114,7 @@ | |||
(apply concat |
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 do we need a concat here? Cant we use a doseq
instead of for
to force the lazy computation?
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.
Good idea, but it's also used in the example test to verify the results.
Thank you for enhancing the example @gigasquid. I left some comments. Overall LGTM! |
Thanks @Chouffe for your review and feedback :) |
* add test for drawing bounding box * Uses the core image drawing bounding box functionality for the object detection example. Adjust the specs and names to make it easier to run with object detection and clojure draw bounding box example * feedback from @Chouffe * refactor to be 3 top predictions instead of 5 to make the images less crowded
* add test for drawing bounding box * Uses the core image drawing bounding box functionality for the object detection example. Adjust the specs and names to make it easier to run with object detection and clojure draw bounding box example * feedback from @Chouffe * refactor to be 3 top predictions instead of 5 to make the images less crowded
Description
Related issue #14506
This builds on #14533
In particular - it uses the core MXNet draw bounding box functionality in the infer objection detection example to unify the use of it in Scala and Clojure.
It also tweaks some of the specs and input names to make the clojure draw bounding box functionality easier to use from the infer object detection.
New output from object detection example:
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.