This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Demonstrates DrawBoundingBoxes, EncodeJpeg and WriteFile - #24
Merged
Conversation
Sample code to load image and perform Object detection with faster_rcnn/inception_resnet_v2_1024x1024
Amended file to match requested changes
Changed copyright year, added parameters for input and output images, close tensors, created new runner
Encapsulated all tensors and a further tidy up
Removes BufferedImage code and uses the DrawBoundingBoxes functionality to add boxes to the image and then converts the Tensor back to a Jpeg and writes the file
Craigacp
suggested changes
Apr 21, 2021
Session.run doesn't require additional calls to tf.init. Added latest output from DrawBoundingBoxes and WriteFile
simplified number of session run calls
Craigacp
suggested changes
Apr 27, 2021
Feeds boxes and image path to placeholders
Moved s.runner() into try catch
Contributor
Author
|
I can't see if there was anything outstanding so re-requesting review |
Craigacp
suggested changes
Jun 9, 2021
Craigacp
left a comment
Contributor
There was a problem hiding this comment.
A small cleanup on the use of outputImage and then this should be good.
| @@ -256,21 +259,18 @@ public static void main(String[] params) { | |||
| DecodeJpeg decodeImage = tf.image.decodeJpeg(readFile.contents(), options); | |||
| //fetch image from file | |||
| try (TUint8 outputImage = (TUint8) runner.fetch(decodeImage).run().get(0)) { | |||
Contributor
There was a problem hiding this comment.
outputImage seems unnecessary now? It's only used for it's shape in lines 337-339, but you've got imageShape here at line 262.
Contributor
Author
There was a problem hiding this comment.
Used imageShape in lines 337-339
Contributor
There was a problem hiding this comment.
Ah, no I meant that you don't need to get outputImage at all, you can use the shape from the decodeImage right?
Tidy up outputImage as imageShape has dimensions of Tensor
inputshape is available
Craigacp
approved these changes
Jun 10, 2021
Craigacp
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for all the work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes BufferedImage code and uses the DrawBoundingBoxes functionality to add boxes to the image and then converts the Tensor back to a Jpeg and writes the file