Demonstrates DrawBoundingBoxes, EncodeJpeg and WriteFile#24
Merged
Craigacp merged 12 commits intotensorflow:masterfrom Jun 10, 2021
Merged
Demonstrates DrawBoundingBoxes, EncodeJpeg and WriteFile#24Craigacp merged 12 commits intotensorflow:masterfrom
Craigacp merged 12 commits intotensorflow:masterfrom
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
requested changes
Apr 21, 2021
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
Session.run doesn't require additional calls to tf.init. Added latest output from DrawBoundingBoxes and WriteFile
simplified number of session run calls
Craigacp
requested changes
Apr 27, 2021
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Show resolved
Hide resolved
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
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
requested changes
Jun 9, 2021
Collaborator
Craigacp
left a comment
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)) { | |||
Collaborator
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
Collaborator
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
Collaborator
Craigacp
left a comment
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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