MobileNetv2-SSD icon indicating copy to clipboard operation
MobileNetv2-SSD copied to clipboard

anchor code error

Open csjiyw opened this issue 1 year ago • 0 comments

for gridSize, numBox, scale in zip(layerWidths,numBoxes,scales): step_size = IMG_SIZE1.0/gridSize for i in range(gridSize): for j in range(gridSize): pos = idx + (igridSize+j) * numBox # centre is the same for all aspect ratios(=numBox) centres[ pos : pos + numBox , :] = istep_size + step_size/2, jstep_size + step_size/2 # height and width vary according to the scale and aspect ratio # zip asepct ratios and then scale them by the scaling factor hw[ pos : pos + numBox , :] = np.multiply(gridSize*scale, np.squeeze(np.dstack([asp1,asp2]),axis=0))[:numBox,:]

idx += gridSizegridSizenumBox

in code: hw[ pos : pos + numBox , :] = np.multiply(gridSize*scale, np.squeeze(np.dstack([asp1,asp2]),axis=0))[:numBox,:]

gridSize is wrong, if gridesize is 1 then only one centre exist ,which is the center of the image, the w&h became 1*scale,however the sacle is 0.1. hence the w&h became 0.1.

i suppose the code should change to : hw[ pos : pos + numBox , :] = np.multiply(step_size*scale, np.squeeze(np.dstack([asp1,asp2]),axis=0))[:numBox,:]

csjiyw avatar Apr 14 '23 09:04 csjiyw