longcw / yolo2-pytorch

YOLOv2 in PyTorch
1.54k stars 421 forks source link

size_index is missing for preprocess_test function #51

Closed aelnouby closed 6 years ago

aelnouby commented 6 years ago

When trying the demo, I found that preprocess_test has two arguments (data, size_index) while in the demo.py file, only one argument is passed yolo_utils.preprocess_test((image, None, cfg.inp_size))[0] , how to fix this ?

Thanks.

lucheng07082221 commented 6 years ago

I got the same problem

CompilerBian commented 6 years ago

Try

im_data = np.expand_dims(
        yolo_utils.preprocess_test((image, None, cfg.inp_size), 0)[0], 0)

Then comment this line in preprocess_test

#inp_size = inp_size[size_index]
lucheng07082221 commented 6 years ago

@CompilerBian thank you very much ,this problem had solved

nijkah commented 6 years ago

@CompilerBian I did it.(editing demo.py and utils/yolo.py) But I get this error.

TypeError: 'numpy.int64' object is not iterable

Same error occurs when removing comment sign on the line you mentioned

longcw commented 6 years ago

Sorry for introduced this bug in the last PR. I just fixed this in the master branch: https://github.com/longcw/yolo2-pytorch/commit/dfdd82270cc946a8e9dcb5f99b5c9958bf05b0bd