encodeSsd2D | R Documentation |
Function for translating the min/max ground truth box coordinates to something expected by the SSD network. This is a SSD-specific analog for keras::to_categorical(). For each image in the batch, we compare the ground truth boxes for that image with all the anchor boxes. If the overlap measure exceeds a specific threshold, we write the ground truth box coordinates and class to the specific position of the matched anchor box. Note that the background class will be assigned to all the anchor boxes for which there was no match with any ground truth box. However, an exception to this are the anchor boxes whose overlap measure is higher that the specified negative threshold.
encodeSsd2D(
groundTruthLabels,
anchorBoxes,
imageSize,
variances = rep(1, 4),
foregroundThreshold = 0.5,
backgroundThreshold = 0.2
)
groundTruthLabels |
A list of length |
anchorBoxes |
a list of 2-D arrays where each element comprises the anchor boxes for a specific aspect ratios layer. The row of each 2-D array comprises a single box specified in the form (xmin,xmax,ymin,ymax). |
imageSize |
2-D vector specifying the spatial domain of the input images. |
variances |
A list of 4 floats > 0 with scaling factors (actually it's
not factors but divisors to be precise) for the encoded predicted box
coordinates. A variance value of 1.0 would apply no scaling at all to the
predictions, while values in |
foregroundThreshold |
float between 0 and 1 determining the min threshold
for matching an anchor box with a ground truth box and, thus, labeling an anchor
box as a non-background class. If an anchor box exceeds the |
backgroundThreshold |
float between 0 and 1 determining the max threshold
for labeling an anchor box as |
This particular implementation was heavily influenced by the following python and R implementations:
\url{https://github.com/pierluigiferrari/ssd_keras} \url{https://github.com/rykov8/ssd_keras} \url{https://github.com/gsimchoni/ssdkeras}
a 3-D array of shape (batchSize
, numberOfBoxes
,
numberOfClasses
+ 4 + 4 + 4)
where the additional 4's along the third dimension correspond to the 4 predicted box coordinate offsets, the 4 coordinates for the anchor boxes, and the 4 variance values.
Tustison NJ
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.