Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 fixes for download_train.py #2

Open
rbarman opened this issue Feb 16, 2019 · 0 comments
Open

python3 fixes for download_train.py #2

rbarman opened this issue Feb 16, 2019 · 0 comments

Comments

@rbarman
Copy link

rbarman commented Feb 16, 2019

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:

  1. Use urllib.request instead urllib
    - see https://stackoverflow.com/questions/3969726/attributeerror-module-object-has-no-attribute-urlopen
  2. Open the csvs with 'r' instead of 'rb'
    - see https://stackoverflow.com/a/28974410/2475380
  3. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant