Skip to content

Instantly share code, notes, and snippets.

View anyashka's full-sized avatar
💭
I may be slow to respond.

Anna-Mariia Shkarlinska anyashka

💭
I may be slow to respond.
View GitHub Profile
@anyashka
anyashka / lunch_model.py
Last active November 3, 2024 15:19
Updatable Lunch Classifier for Core ML
# Creating a model with TuriCreate
import turicreate as tc
data = tc.image_analysis.load_images('image/train', with_path=True)
data['label'] = data['path'].apply(lambda path: 'healthy' if '/healthy' in path else 'fast food')
model = tc.image_classifier.create(data, target='label')
model.save("LunchImageClassifier.model")
model.export_coreml('LunchImageClassifier.mlmodel')