Skip to content

Instantly share code, notes, and snippets.

View vmalyi's full-sized avatar
💭
What's happening?

Viktor Malyi vmalyi

💭
What's happening?
View GitHub Profile
@vmalyi
vmalyi / main.dart
Created June 3, 2021 12:02
Dartpad test
test
@vmalyi
vmalyi / Run or Walk (Part 4): Use imported Core ML model to make predictions
Created November 12, 2017 20:10
Run or Walk (Part 4): Import Keras Neural Network to iOS app with Core ML
import Foundation
import CoreML
enum ClassifierError : Error {
case RuntimeError(String)
}
class Classifier: NSObject {
let model = accel_x_model()
@vmalyi
vmalyi / autoworkout_oss.html
Last active March 29, 2018 13:43
autoworkout_oss.html
<h1>Open Source Licenses – AutoWorkout app</h1>
<h2>PureLayout</h2>
<p>Copyright (c) 2014-2015 Tyler Fox</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &quot;Software&quot;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN A
@vmalyi
vmalyi / autoworkout_privacy_policy.html
Created December 6, 2017 22:42
AutoWorkout privacy policy
<h1>PRIVACY POLICY MODEL FOR AUTOWORKOUT APPLICATION</h1>
<p><br />This privacy policy governs your use of the software application AutoWorkout (&ldquo;Application&rdquo;) for mobile devices that was created by Viktor Malyi ("Developer").</p>
<h2><br />User Provided Information</h2>
<p>The Application obtains the username, wrist the user is wearing the Apple Watch on. You are not required to enter this information and are allowed to use the Application without any limitations without providing it.</p>
<h2><br />Usage of User Provided Information</h2>
<p>The information provided by you will be used for analyzing the usage patterns of the Application.</p>
<h2><br />Automatically Collected Information</h2>
<p>In addition, the Application may collect certain information automatically, including, but not limited to, accelerometer data, the type of mobile device you use, your mobile devices unique device ID, the IP address of your mobile device, your mobile operating system.</p>
<h2><br />Usage of Automatically Col
@vmalyi
vmalyi / Run or Walk (Part 4): Showing the "walk" or "run" image based on model's prediction
Created November 12, 2017 20:18
Run or Walk (Part 4): Import Keras Neural Network to iOS app with Core ML
class PredictionViewController: UIViewController,
...
try! Classifier().makePrediction(inputData) == 0 ? showWalkImage() : showRunImage()
@vmalyi
vmalyi / Run or Walk (Part 4): Converting Keras model to Core ML
Last active November 12, 2017 19:48
Run or Walk (Part 4): Import Keras Neural Network to iOS app with Core ML
from keras.models import model_from_json
import coremltools
import os
with open(os.path.join(KERAS_MODEL_FOLDER, model), 'r') as f:
loaded_model_json = f.read()
keras_model = model_from_json(loaded_model_json)
keras_model.load_weights(os.path.join(KERAS_MODEL_WEIGHTS_FOLDER, weights))
@vmalyi
vmalyi / Run or Walk (Part 4) - Saving the model's weights
Last active November 12, 2017 19:36
Run or Walk (Part 4): Import Keras Neural Network to iOS app with Core ML
...
# save model's weights to disk
model.save_weights("model_weights.h5")
@vmalyi
vmalyi / Run or Walk (Part 4) - Saving the model
Last active November 12, 2017 19:33
Run or Walk (Part 4): Import Keras Neural Network to iOS app with Core ML
...
model.fit(X, Y, epochs=NUMBER_OF_EPOCHS, batch_size=BATCH_SIZE)
...
# serialize model to JSON
model_json = model.to_json()
# save JSON to the disk
with open("saved_model.json", "w") as json_file:
json_file.write(model_json)
@vmalyi
vmalyi / ideal_workout_privacy_policy.html
Last active October 17, 2017 18:54
ideal workout privacy policy
<h1>PRIVACY POLICY MODEL FOR IDEAL WORKOUT APPLICATION</h1>
<p><br />This privacy policy governs your use of the software application Ideal Workout (&ldquo;Application&rdquo;) for mobile devices that was created by Viktor Malyi ("Developer").</p>
<h2><br />User Provided Information</h2>
<p>The Application obtains the username, wrist the user is wearing the Apple Watch on. You are not required to enter this information and are allowed to use the Application without any limitations without providing it.</p>
<h2><br />Usage of User Provided Information</h2>
<p>The information provided by you will be used for analyzing the usage patterns of the Application.</p>
<h2><br />Automatically Collected Information</h2>
<p>In addition, the Application may collect certain information automatically, including, but not limited to, accelerometer data, the type of mobile device you use, your mobile devices unique device ID, the IP address of your mobile device, your mobile operating system.</p>
<h2><br />Usage of Automatically
[color]
ui = auto
[core]
excludesfile = /Users/malyi/.gitignore_global
autocrlf = input
[user]
name = Viktor Malyi
email = v.stratus@gmail.com
[alias]