Skip to content

Reshaping boxes in create_detections: size not consistent #8

@acscas

Description

@acscas

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions