Created
July 1, 2018 07:13
-
-
Save varokas/d32ba375666a399dbe754b883afba7df to your computer and use it in GitHub Desktop.
turicreate-examples-02-prepare.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import turicreate as tc | |
# There will be a few 'Unexpected JPEG decode failure' ignore those | |
data = tc.image_analysis.load_images('data/', with_path=True) | |
# Apple Label column to each data based on whether they have the word 'apple' or 'orange' in path | |
data['label'] = data['path'].apply(lambda path: 'apple' if '/apples' in path else 'orange') | |
# Save this information as a frame to use later | |
data.save('apples-oranges.sframe') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment