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

Tip: in data.py it is significantly faster to use Python lists instead of np.append() #1

Open
sebasibarguen opened this issue Feb 10, 2017 · 1 comment

Comments

@sebasibarguen
Copy link

Hey! Awesome code, read you blog post and found your data augmentation methods awesome.

I checked out the data.py file, and noticed you were using np.append to add a new image to the feature set. It is much faster to first use Python lists, and then convert them numpy arrays later. It can be from 10 -30 times faster.

So you could do something like:

x = []
y = []
...
x.append(image)
y.append(angle)
...
x = np.asarray(x)
y = np.asarray(y)
@alexstaravoitau
Copy link
Owner

Thanks @sebasibarguen, awesome hint! I know it's an old issue (sorry my notifications were turned off), but feel free to submit a PR if you happen to work on this again. 🙂

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

2 participants