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
BroadcastReceiver mqtt_reciever = new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
String data = intent.getStringExtra("msg-sub"); | |
Log.d("MQTT", "Temperature"+ data); | |
} | |
}; | |
//launch |
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
#from models/object_detection | |
python3 train.py --logstderr --train_dir=training/ --pipeline_config_path=data/ssd_mobilenet_v1_coco.config |
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
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch app/src/main/assets/yolo.pb' HEAD | |
OR | |
git filter-branch -f \ [15:23:39] | |
--index-filter 'git rm --cached --ignore-unmatch app/src/main/assets/output_graph_opt.pb' HEAD |
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
# training_gen = generator_batch(X_train) | |
# val_gen = generator_batch(X_validation) | |
datagen = ImageDataGenerator( | |
featurewise_center=True, | |
featurewise_std_normalization=True, | |
rotation_range=20, | |
width_shift_range=0.2, | |
height_shift_range=0.2, | |
horizontal_flip=True) |
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
datagen = ImageDataGenerator( | |
featurewise_center=True, # set input mean to 0 over the dataset | |
samplewise_center=False, # set each sample mean to 0 | |
featurewise_std_normalization=True, # divide inputs by std of the dataset | |
samplewise_std_normalization=False, # divide each input by its std | |
zca_whitening=False, # apply ZCA whitening | |
rotation_range=20, # randomly rotate images in the range (degrees, 0 to 180) | |
width_shift_range=0.2, # randomly shift images horizontally (fraction of total width) | |
height_shift_range=0.2, # randomly shift images vertically (fraction of total height) | |
horizontal_flip=True, # randomly flip images |
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
# Save | |
dist_pickle = {} | |
dist_pickle["mtx"] = mtx | |
dist_pickle["dist"] = dist | |
pickle.dump( dist_pickle, open( filename, "wb" ) ) | |
#load | |
#1.1 load pickle | |
calib_dist = pickle.load(open(filename,"rb")) |
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
def generator(features=X_train, labels=y_train, batch_size=FLAGS.batch_size): | |
# Create empty arrays to contain batch of features and labels# | |
batch_features = np.zeros((batch_size,160,320,3)) | |
print("batch_feature shape is {}".format(batch_features.shape)) | |
batch_labels = np.zeros((batch_size,1)) | |
while True: | |
for i in range(batch_size): | |
#choose random index in features | |
index= random.choice(len(features),1) | |
batch_features[i] = features[index] |
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 pandas as pd | |
# type of reader is dataframe | |
reader = pd.read_csv('./data/example.csv', usecols=['c1','c2','c5','c10'] ) #choose csv file labels | |
#iterate through dataframe and get specific values | |
for index, row in reader.iterrows(): | |
print(row['c1'], row['c10']) |
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
# Here's how you would run the file | |
# from the command line: python feature_extraction.py --training_file vgg_cifar10_100_bottleneck_features_train.p | |
# --validation_file vgg_cifar10_bottleneck_features_validation.p | |
flags = tf.app.flags | |
FLAGS = flags.FLAGS | |
# command line flags | |
flags.DEFINE_string('training_file', '', "Bottleneck features training file (.p)") | |
flags.DEFINE_string('validation_file', '', "Bottleneck features validation file (.p)") |
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
from keras.datasets import cifar10 | |
(X_train, y_train), (X_test, y_test) = cifar10.load_data() | |
# y_train.shape is 2d, (50000, 1). While Keras is smart enough to handle this | |
# it's a good idea to flatten the array. | |
y_train = y_train.reshape(-1) | |
y_test = y_test.reshape(-1) | |
assert(len(X_train) == len(y_train)) | |
assert(len(X_test) == len(y_test)) |
NewerOlder