Skip to content

Demonstrates DrawBoundingBoxes, EncodeJpeg and WriteFile#24

Merged
Craigacp merged 12 commits intotensorflow:masterfrom
pyrator:patch-1
Jun 10, 2021
Merged

Demonstrates DrawBoundingBoxes, EncodeJpeg and WriteFile#24
Craigacp merged 12 commits intotensorflow:masterfrom
pyrator:patch-1

Conversation

@pyrator
Copy link
Contributor

@pyrator pyrator commented Apr 18, 2021

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

pyrator added 5 commits April 3, 2021 17:24
Sample code to load image and perform Object detection with faster_rcnn/inception_resnet_v2_1024x1024
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
@google-cla google-cla bot added the cla: yes label Apr 18, 2021
pyrator added 2 commits April 26, 2021 15:22
Session.run doesn't require additional calls to tf.init. Added latest output from DrawBoundingBoxes and WriteFile
simplified number of session run calls
pyrator added 2 commits April 27, 2021 10:03
Feeds boxes and image path to placeholders
Moved s.runner() into try catch
@pyrator
Copy link
Contributor Author

pyrator commented Jun 8, 2021

I can't see if there was anything outstanding so re-requesting review

@pyrator pyrator requested a review from Craigacp June 8, 2021 20:00
Copy link
Collaborator

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used imageShape in lines 337-339

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no I meant that you don't need to get outputImage at all, you can use the shape from the decodeImage right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes got you

pyrator added 2 commits June 9, 2021 18:39
Tidy up outputImage as imageShape has dimensions of Tensor
inputshape is available
Copy link
Collaborator

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for all the work.

@Craigacp Craigacp merged commit 0489e6b into tensorflow:master Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants