Closed ruikun closed 6 years ago
@leeyoshinari 而且为什么要先除掉image_size再开方呢? 此外我注意到你的yolov1,yolov2,yolov3在计算box的 x,y,w,h 的方式上都不一样, yolo v1:boxes = [(x2 + x1) / 2.0, (y2 + y1) / 2.0, x2 - x1, y2 - y1] yolo v2:如楼上 yolo v3:boxes = [0.5 (x1 + x2) / self.image_size, 0.5 (y1 + y2) / self.image_size, np.sqrt((x2 - x1) / self.image_size), np.sqrt((y2 - y1) / self.image_size)]
请问是有什么原理上的不同吗?我的理解的话应该就是yolo v1那种形式,很困惑,望赐教。
yolo v1's original is "Sum-squared error also equally weights errors in large boxes and small boxes. Our error metric should reflect that small deviations in large boxes matter less than in small boxes. To partially address this we predict the square root of the bounding box width and height instead of the width and height directly." It is not impossible to directly subtract.
The code you mentioned for calculating boxes isn't real, it's just preprocessing. You have to see how boxes are calculated when calculating loss. If this, you will find that the calculations for yolo's boxes are very similar.
你好,在preprocess.py 文件中计算box的 x,y,w,h 的代码如下: boxes = [0.5 (x1 + x2), 0.5 (y1 + y2), np.sqrt((x2 - x1) / self.image_size), np.sqrt((y2 - y1) / self.image_size)]
请问w,h,的计算问什么要经过开平方? 直接相减不行吗?