A few fixes are required to download_train.py if anyone is using python3.
Current dependency versions (using google colab):
- python : 3.6.7
- opencv-python : 3.4.5.20
Fixes:
- Use
urllib.request instead urllib
- see https://stackoverflow.com/questions/3969726/attributeerror-module-object-has-no-attribute-urlopen
- Open the csvs with 'r' instead of 'rb'
- see https://stackoverflow.com/a/28974410/2475380
- cv2 needs integers when resizing
- I get TypeError: integer argument expected, got float when trying to resize images in download_and_resize()
- One solution is to use integer division like: height = (640 * img.shape[0]) // img.shape[1]
I have these changes ready. However I am not sure I should send in a pull request if the main users in this repo use python2.7 and these changes would cause them issues.
A few fixes are required to download_train.py if anyone is using python3.
Current dependency versions (using google colab):
Fixes:
urllib.requestinsteadurllib- see https://stackoverflow.com/questions/3969726/attributeerror-module-object-has-no-attribute-urlopen
- see https://stackoverflow.com/a/28974410/2475380
- I get
TypeError: integer argument expected, got floatwhen trying to resize images in download_and_resize()- One solution is to use integer division like:
height = (640 * img.shape[0]) // img.shape[1]I have these changes ready. However I am not sure I should send in a pull request if the main users in this repo use python2.7 and these changes would cause them issues.