Skip to content

Commit c5216c3

Browse files
authored
Merge pull request #40 from nanowireUK/network
Read placeholder size from graph
2 parents 5025dd5 + 0cd1dfd commit c5216c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/ImageClassifierService/app/predict.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
filename = 'model.pb'
1414
labels_filename = 'labels.txt'
1515

16-
network_input_size = 227
1716
mean_values_b_g_r = (0,0,0)
1817

1918
size = (256, 256)
@@ -58,6 +57,9 @@ def predict_image(image):
5857
with tf.Session() as sess:
5958
prob_tensor = sess.graph.get_tensor_by_name(output_layer)
6059

60+
input_tensor_shape = sess.graph.get_tensor_by_name('Placeholder:0').shape.as_list()
61+
network_input_size = input_tensor_shape[1]
62+
6163
# w = image.shape[0]
6264
# h = image.shape[1]
6365
w, h = image.size

0 commit comments

Comments
 (0)