fix: yolov5 get width (#566)

This commit is contained in:
makaveli 2021-05-25 18:17:16 +05:30 committed by GitHub
parent d274d90722
commit 668d89bbd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
#include <iostream>
#include <chrono>
#include <cmath>
#include "cuda_utils.h"
#include "logging.h"
#include "common.hpp"
@ -23,10 +24,8 @@ static Logger gLogger;
static int get_width(int x, float gw, int divisor = 8) {
//return math.ceil(x / divisor) * divisor
if (int(x * gw) % divisor == 0) {
return int(x * gw);
}
return (int(x * gw / divisor) + 1) * divisor;
return int(ceil((x * gw) / divisor)) * divisor;
}
static int get_depth(int x, float gd) {