Hello! When using yolo.py , after inputting the path to the image,"/home/image.jpg" i get the following error:
Traceback (most recent call last):
File "yolo.py", line 215, in
detect_img(YOLO())
File "yolo.py", line 208, in detect_img
r_image = yolo.detect_image(image)
File "yolo.py", line 92, in detect_image
boxed_image = letterbox_image(image, tuple(reversed(self.model_image_size)))
File "/home/keras-yolo/keras-yolo3/yolo3/utils.py", line 28, in letterbox_image
image = image.resize((nw,nh), Image.BICUBIC)
File "/root/anaconda2/lib/python2.7/site-packages/PIL/Image.py", line 1554, in resize
return self.convert('RGBa').resize(size, resample).convert('RGBA')
File "/root/anaconda2/lib/python2.7/site-packages/PIL/Image.py", line 1556, in resize
return self._new(self.im.resize(size, resample))
ValueError: height and width must be > 0
I'am using python 2.7.
Any idea why i'am getting this error (tried multiples images , .png an .jpg)?
Ok found out why,
it was because scale = min(w/iw, h/ih) was 0
adding "from __future__ import division" at the beginning of utils.py fixed the issue.
Add from __future__ import division at the beginning of utils.py
Ok found out why,
it was because scale = min(w/iw, h/ih) was 0
adding "from future import division" at the beginning of utils.py fixed the issue.
Ok found out why,
it was because scale = min(w/iw, h/ih) was 0
adding "from future import division" at the beginning of utils.py fixed the issue.
it needs to be from __future__ import division in python2.7, __ can be transferred into '**' in this editor, so you can choose insert code to resolve this.
from future import division
ModuleNotFoundError: No module named 'future'
Most helpful comment
Add
from __future__ import divisionat the beginning ofutils.py