[IE][VPU] Yolo_v5 support (#5976)

Changing the threshold for VPU scales
This commit is contained in:
Daria Mityagina 2021-06-09 16:27:52 +03:00 committed by GitHub
parent 8dd914477c
commit 3bc2c46693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ bool checkGrowingOutput(const Model& model) {
return false;
}
static const float SCALE_THRESHOLD = 0.125f;
static const float SCALE_THRESHOLD = 0.1f;
for (const auto& stage : model->getStages()) {
if (stage->type() != StageType::Power &&
@ -248,14 +248,13 @@ void PassImpl::run(const Model& model) {
if (firstStage && shift < 4 && isGrowingOutput && weights->desc().dim(Dim::C) > 1) {
normalVal = 5;
}
shift = correctShift(shift, firstStage, stage->origLayer()->type);
shift -= normalVal;
}
firstStage = false;
scale = 1;
if (shift > scaleThreshold) {
if (shift >= scaleThreshold) {
scale = static_cast<float>(1ULL << static_cast<std::uint32_t>(shift));
}