Created
August 27, 2018 19:33
-
-
Save 0xjorgev/e541bbf3c24668863c3e1926d9ba3170 to your computer and use it in GitHub Desktop.
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 | |
# Load the style and content images | |
styles = tc.load_images('style/') | |
content = tc.load_images('content/') | |
# Create a StyleTransfer model | |
model = tc.style_transfer.create(styles, content) | |
# Load some test images | |
test_images = tc.load_images('test/') | |
# Stylize the test images | |
stylized_images = model.stylize(test_images) | |
# Save the model for later use in Turi Create | |
model.save('mymodel.model') | |
# Export for use in Core ML | |
model.export_coreml('MyStyleTransfer.mlmodel') | |
#Show the results | |
stylized_images = model.stylize(test_images) | |
stylized_images.explore() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment