DIUx-xView/xView1_baseline

Reshaping boxes in create_detections: size not consistent

acscas opened this issue · 1 comments

Great code, thanks for making it available and writing the Medium articles!

Having an issue running create_detections.py: the reshape code at line 132 throws an error when I run it on a single image:

Traceback (most recent call last):
  File "../DIUx_code/baseline-master/inference/create_detections.py", line 132, in <module>
    bfull = boxes[:wn*hn].reshape((wn,hn,num_preds,4))
ValueError: cannot reshape array of size 40000 into shape (10,10,250,4)

The image is 1036.tif, with a size of 3215 x 3195. The default chip size (300,300) create wn = 10, hn = 10. And the "boxes" variable from "generate_detections" is shape [100,100,4]. So the reshape call (with num_preds=250 as default) requires the boxes[:100] to be 100k but it's 100x100x4=40k in size.

Have you run into this? Not sure of a simple fix. Thanks!

I have the same problem. It works fine if I use create_detections.py with the vanilla model provided but it does not work if I use a different model configuration. I am trying to find out how I can modify it to match the current model I am using (ssd_mobilenet_v1_coco).