You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I executed the following command.
"""python3 object_detection.py --input=./test.jpg --model=./yolov3.weights --config=./yolov3.cfg --classes=./object_detection_classes_coco.txt --scale=0.00392 --width=416 --height=416
"""
All errors are below.
'''Traceback (most recent call last):
File "object_detection.py", line 196, in
postprocess(frame, outs)
File "object_detection.py", line 162, in postprocess
drawPred(classIds[i], confidences[i], left, top, left + width, top + height)
File "object_detection.py", line 73, in drawPred
cv.rectangle(frame, (left, top), (right, bottom), (0, 255, 0))
TypeError: integer argument expected, got float
'''
System information (version)
Detailed description
I tried to do the Python3 OpenCV-Sample on yolov3.
I executed opencv/samples/dnn/object_detection.py. (https://github.com/opencv/opencv/blob/3.4.2/samples/dnn/object_detection.py)
But it did not work with errors(TypeError: integer argument expected, got float).
I executed the following command.
"""python3 object_detection.py --input=./test.jpg --model=./yolov3.weights --config=./yolov3.cfg --classes=./object_detection_classes_coco.txt --scale=0.00392 --width=416 --height=416
"""
All errors are below.
'''Traceback (most recent call last):
File "object_detection.py", line 196, in
postprocess(frame, outs)
File "object_detection.py", line 162, in postprocess
drawPred(classIds[i], confidences[i], left, top, left + width, top + height)
File "object_detection.py", line 73, in drawPred
cv.rectangle(frame, (left, top), (right, bottom), (0, 255, 0))
TypeError: integer argument expected, got float
'''
I guess that in Python 3 the following operation result is a floating point number, not an integer.
https://github.com/opencv/opencv/blob/3.4.2/samples/dnn/object_detection.py#L145-L146
The text was updated successfully, but these errors were encountered: