Skip to content

Instantly share code, notes, and snippets.

@varokas
Created July 1, 2018 07:13
Show Gist options
  • Save varokas/d32ba375666a399dbe754b883afba7df to your computer and use it in GitHub Desktop.
Save varokas/d32ba375666a399dbe754b883afba7df to your computer and use it in GitHub Desktop.
turicreate-examples-02-prepare.py
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