question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get bounding box from custom trained model detection?

See original GitHub issue

Hi,

I’ve trained a custom model with one object, converted it into graph model and using on the browser. Here is my code:

        async function predict() {
            const model = await tf.loadGraphModel('./model/model.json');
            let img = document.getElementById('test');

            var example = tf.browser.fromPixels(img);
            example = example.expandDims(0);

            const output = await model.executeAsync(example);
            output.forEach(val=>{
                console.log(val);
            });
        }

It’s giving these values:

t {kept: false, isDisposedInternal: false, shape: Array(3), dtype: "float32", size: 1200, …}
t {kept: false, isDisposedInternal: false, shape: Array(3), dtype: "float32", size: 600, …}
t {kept: false, isDisposedInternal: false, shape: Array(1), dtype: "float32", size: 1, …}
t {kept: false, isDisposedInternal: false, shape: Array(3), dtype: "float32", size: 600, …}
t {kept: false, isDisposedInternal: false, shape: Array(3), dtype: "float32", size: 1200, …}
t {kept: false, isDisposedInternal: false, shape: Array(5), dtype: "float32", size: 4915200, …}
t {kept: false, isDisposedInternal: false, shape: Array(2), dtype: "float32", size: 300, …}
t {kept: false, isDisposedInternal: false, shape: Array(2), dtype: "float32", size: 300, …}

How can I know is there any mathces/predictions on the image? And if is there, how can I get the bounding box of it?

The pretrained models have these options. But how can we do it on our own models?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tafsiricommented, Mar 16, 2020

I’m going to close this issue since the original problem has been solved. But if you are looking for more general “how can I do X” tips. I would suggest using StackOverFlow, there is both a tensorflow tag and a tensorflow.js that may have some helpful pointers. You might also find some of the online courses listed on this page helpful.

0reactions
sundowatchcommented, Mar 15, 2020

I’ve now trained with AutoML and it works fine. But don’t know why can’t I use it with tensorflow training.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object detection: Bounding box regression with Keras ...
In this tutorial you will learn how to train a custom deep learning model to perform object detection via bounding box regression with...
Read more >
Building an object detector in TensorFlow using bounding-box ...
I achieved this by grabbing the base layers and the localisation branch layers using their respective prefixes and setting the trainable ...
Read more >
Bounding Box Prediction from Scratch using PyTorch
Object detection is a very popular task in Computer Vision, where, given an image, you predict (usually rectangular) boxes around objects ...
Read more >
14.3. Object Detection and Bounding Boxes
In object detection, we usually use a bounding box to describe the spatial location of an object. The bounding box is rectangular, which...
Read more >
Labeling objects with bounding boxes - Rekognition
If you want your model to detect the location of objects within an image, you must identify what the object is and where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found