SSD postprocessing layer
ACL version: 20.02.1 OS: Android 8.1
I am trying to implement SSD MobilenetV3 small downloaded from here [tensorflow model zoo] on ACL Graph APIs.
I managed to get all the layers working till last but one layer (before PostProcessing Layer). I have tried to implement post processing layer by 2 different methods available with Graph APIs. But I am struggling to get the correct results.
- Using "DetectionPostProcessLayer":
const int max_detections = 100;
const int max_classes_per_detection = 1;
const float nms_score_threshold = 0.30000001192092896f;
const float nms_iou_threshold = 0.2;//0.6000000238418579f;
const int num_classes = 90;
const float x_scale = 10.f;
const float y_scale = 10.f;
const float h_scale = 5.f;
const float w_scale = 5.f;
std::array<float, 4> scales = { y_scale, x_scale, w_scale, h_scale };
out_final << DetectionPostProcessLayer(
std::move(out_conf),
DetectionPostProcessLayerInfo(max_detections, max_classes_per_detection, nms_score_threshold,
nms_iou_threshold, num_classes, scales, false, 100, true),
get_weights_accessor(data_path, "anchors_t.npy", DataLayout::NCHW)).set_name("DetectionPostProcess");
- Using "DetectionOutputLayer":
const int num_classes = 91;
const bool share_location = true;
const DetectionOutputLayerCodeType detection_type = DetectionOutputLayerCodeType::CENTER_SIZE;
const int keep_top_k = 100;
const float nms_threshold = 0.6f;
const int label_id_background = 0;
const float conf_thrs = 0.15f;
const int top_k = 100;
detection_ouput << DetectionOutputLayer(std::move(out_conf), std::move(out_prior),
DetectionOutputLayerInfo(num_classes, share_location, detection_type, keep_top_k,
nms_threshold, top_k, label_id_background, conf_thrs));
Both the methods are not giving correct results. I compared the output till last but one layer with Tensorflow output and it is matching. Probably I am doing something wrong.
Can you please help me to define the last layer of SSD MobilenetV3 Small network? Any hint/advise would be of very much help.
Thanks, krgor
@morgolock , I have tried with ACL 20.08 and seeing the same issue as previous versions. As you have put v20.08 as milestone; is the mentioned issue fixed with ACL 20.08?
Can you please advise? Thanks, krgor
Hi @krgor
I've updated the tag to 20.11, we'll look into this in the next few days.
@morgolock, Is there any update on this issue? Is it covered in ACL 20.11?
Hi @krgor
Please take a look at our example https://github.com/ARM-software/ComputeLibrary/blob/master/examples/graph_ssd_mobilenet.cpp#L680 to see how we configure the DetectionPostProcessLayer in SSD Mobilinet V1.
It's likely the configuration you shared above is not correct.
Hope this helps.
Hi @krgor

Could you please double check making the following changes:
const float nms_score_threshold = 9.99999993922529e-9;
const float nms_iou_threshold = 0.6000000238418579;
Hope this helps.
Thanks @morgolock . I will try this and get back to you.
I have tried with mentioned values but it didn't help. Now it just works on all the boxes having confidence more than 9.99999993922529e-9 (very small number).
I have also tried playing with exact same values as "DetectionOutputLayer" of "https://github.com/ARM-software/ComputeLibrary/blob/master/examples/graph_ssd_mobilenet.cpp#L680"; but that also didn't help. Looks like some bug in calculation. Can you please point out the implementation of these layers? I will try to explore more on that.
Hi @krgor
You can look at the implementation here:
https://github.com/ARM-software/ComputeLibrary/blob/master/src/runtime/NEON/functions/NEDetectionPostProcessLayer.cpp
Please reopen if you still need support.