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.

RetinaNet code example

See original GitHub issue

@srihari-humbarwadi I’m following the keras code example on object detection, retina-net, and a few things are not clear to me.

  1. anchor box: It uses an anchor box by assuming the target shape (xmin, ymin, width, height). Now, what if the target is (xmin, ymin, xmax, ymax)? Code.
class AnchorBox:
    """Generates anchor boxes.
    This class has operations to generate anchor boxes for feature maps at
    strides `[8, 16, 32, 64, 128]`. Where each anchor each box is of the
    format `[x, y, width, height]`.
....

What do I need to change of the above code? Direct Code link.

  1. In data pipelines, what is the use of padding and the values, like below:
train_dataset = train_dataset.padded_batch(
    batch_size=batch_size, 
   padding_values=(0.0, 1e-8, -1), 
   drop_remainder=True
)

and why we use

train_dataset.apply(tf.data.experimental.ignore_errors())

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
old-school-kidcommented, Dec 12, 2021

Do you mind giving some suggestions regarding anchor optimization for custom data set? Is it possible to auto-tune it by itself based on the custom data? (pointer)

As fas as I know this is SOTA mechanism when it comes to anchor boxes. And as always K-Means also produces quite satisfatory results. You can also try out IoU loss.

1reaction
srihari-humbarwadicommented, Dec 9, 2021

I hope that the comments above do resolve your queries @Suzan009, and for

In data pipelines, what is the use of padding and the values, like below:

The model is trained on variable image sizes. Hence, to accommodate images of different sizes in a batch, we pad the images and labels.

  • images are padded with 0s
  • boxes are padded with a small float value 1e-8
  • and class ids are padded with -1 (ignore label)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Detection with RetinaNet - Keras
Here in this example, we will implement RetinaNet, a popular single-stage detector, which is accurate and runs fast.
Read more >
Keras implementation of RetinaNet object detection. - GitHub
Keras implementation of RetinaNet object detection as described in Focal Loss for Dense Object Detection by Tsung-Yi Lin, Priya Goyal, Ross Girshick, ...
Read more >
RetinaNet Explained | Papers With Code
RetinaNet is a single, unified network composed of a backbone network and two task-specific subnetworks. The backbone is responsible for computing a ...
Read more >
How RetinaNet works? | ArcGIS API for Python
Introduction. RetinaNet is one of the best one-stage object detection models that has proven to work well with dense and small scale objects....
Read more >
Build a Face Mask Detector using RetinaNet | With Python Code
We'll build a “Face mask detector” using RetinaNet to help us in this ongoing pandemic. You can extrapolate the same idea to build...
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