View svc-worker-0.yaml
This file contains 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: istio-ingressgateway-ext-worker-0 | |
istio: ingressgateway | |
name: istio-ingressgateway-ext-worker-0 | |
namespace: istio-system | |
annotations: | |
metallb.universe.tf/allow-shared-ip: ing |
View istio-values.yaml
This file contains 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
gateways: | |
enabled: true | |
istio-ingressgateway: | |
type: ClusterIP #change to NodePort, ClusterIP or LoadBalancer if need be | |
ports: | |
- port: 80 | |
targetPort: 80 | |
name: http2 | |
- port: 443 | |
name: https |
View tensorflow_predictint_function.py
This file contains 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 sys | |
import tensorflow as tf | |
def predictint(imvalue): | |
""" | |
This function returns the predicted integer. | |
The imput is the pixel values from the imageprepare() function. | |
""" | |
# Define the model (same as when creating the model file) |
View use_model1.py
This file contains 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
with tf.Session() as sess: | |
sess.run(init_op) | |
saver.restore(sess, "model.ckpt") | |
#print ("Model restored.") | |
prediction=tf.argmax(y,1) | |
return prediction.eval(feed_dict={x: [imvalue]}, session=sess) |
View use_model2.py
This file contains 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
with tf.Session() as sess: | |
sess.run(init_op) | |
saver.restore(sess, "model2.ckpt") | |
#print ("Model restored.") | |
prediction=tf.argmax(y_conv,1) | |
return prediction.eval(feed_dict={x: [imvalue],keep_prob: 1.0}, session=sess) |
View function_prepare_image.py
This file contains 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 PIL import Image, ImageFilter | |
def imageprepare(argv): | |
""" | |
This function returns the pixel values. | |
The imput is a png file location. | |
""" | |
im = Image.open(argv).convert('L') | |
width = float(im.size[0]) | |
height = float(im.size[1]) |
View install_pillow.py
This file contains 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
sudo pip install Pillow |
View tensorflow_saver_restore1.py
This file contains 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
saver.restore(sess, "model.ckpt") |
View tensorflow_saver2.py
This file contains 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_path = saver.save(sess, “model.ckpt”) | |
print (“Model saved in file: “, save_path) |
View tensorflow_saver1.py
This file contains 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
saver = tf.train.Saver() |