Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created December 20, 2017 15:53
Show Gist options
  • Save azamsharp/8635f13f339a5ffb120f41521625dce0 to your computer and use it in GitHub Desktop.
Save azamsharp/8635f13f339a5ffb120f41521625dce0 to your computer and use it in GitHub Desktop.
Tagging Images
import turicreate as tc
# load the images
data = tc.image_analysis.load_images('images', with_path = True)
data['label'] = data['path'].apply(lambda path:'dog' if 'dog' in path else 'cat')
print(data.groupby('label',[tc.aggregate.COUNT]))
# save the data
data.save('cats-dogs.sframe')
data.explore()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment