Skip to content

Commit

Permalink
Changing make_pickle to read_image in one more location
Browse files Browse the repository at this point in the history
  • Loading branch information
scottcoughlin2014 committed Aug 2, 2018
1 parent 5168eb3 commit 1332e70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions gravityspy/ML/labelling_test_glitches.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def main(image_data, model_adr, image_size=[140, 170], verbose=False):
columns whose names are the same as
the image and whose row entries are
the b/w pixel values at some resoltion
determined by `make_pickle`
determined by `read_image`
model_adr : `str` path to folder containing model
Expand Down Expand Up @@ -47,7 +47,7 @@ def label_glitches(image_data, model_adr, image_size=[140, 170], verbose=False):
This is a DF with columns whose names are the same as
the image and whose row entries are
the b/w pixel values at some resoltion
determined by `make_pickle`
determined by `read_image`
model_adr (str, optional):
Path to folder containing model
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_feature_space(image_data, semantic_model_adr, image_size=[140, 170],
This is a DF with columns whose names are the same as
the image and whose row entries are
the b/w pixel values at some resoltion
determined by `make_pickle`
determined by `read_image`
semantic_model_adr (str):
Path to folder containing similarity model
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_multiview_feature_space(image_data, semantic_model_adr, image_size=[140,
This is a DF with columns whose names are the same as
the image and whose row entries are
the b/w pixel values at some resoltion
determined by `make_pickle`
determined by `read_image`
semantic_model_adr (str):
Path to folder containing similarity model
Expand Down
12 changes: 7 additions & 5 deletions gravityspy/ML/train_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import numpy as np
import os
import make_pickle_for_linux as make_pickle
import read_image
import pandas as pd

'''
Expand Down Expand Up @@ -154,7 +154,7 @@ def pickle_trainingset(path_to_trainingset,
for idur in isample:
if verbose:
logger.info('Converting {0}'.format(idur))
image_data = make_pickle.main(os.path.join(path_to_trainingset,
image_data = read_image.read_grayscale(os.path.join(path_to_trainingset,
iclass, idur), resolution=0.3)
information_on_image = idur.split('_')
tmpDF[information_on_image[-1]] = [image_data]
Expand Down Expand Up @@ -351,16 +351,18 @@ def make_model(data, model_folder='model', batch_size=22, nb_epoch=10,

logger.info('Concatenating multiple views ...')
concat_train = concatenate_views(train_set_x_1, train_set_x_2,
train_set_x_3, train_set_x_4, [img_rows, img_cols])
train_set_x_3, train_set_x_4, [img_rows, img_cols], False)
concat_valid = concatenate_views(validation_x_1, validation_x_2,
validation_x_3, validation_x_4,
[img_rows, img_cols])
[img_rows, img_cols], False)

if fraction_testing:
concat_test = concatenate_views(testing_x_1, testing_x_2,
testing_x_3, testing_x_4,
[img_rows, img_cols])
[img_rows, img_cols], False)

import pdb
pdb.set_trace()
cnn1 = build_cnn(img_rows*2, img_cols*2)
final_model = Sequential()
final_model.add(cnn1)
Expand Down

0 comments on commit 1332e70

Please sign in to comment.