Skip to content

Instantly share code, notes, and snippets.

View ZachisGit's full-sized avatar
:octocat:

Zacharias Böhler ZachisGit

:octocat:
  • avameo GmbH
  • Wiesbaden
View GitHub Profile
@ZachisGit
ZachisGit / ExportModel.py
Last active January 6, 2023 13:51
Make your model Tensorflow Serving compatible and modify it to accept png encoded images as input and return png encoded images as output.
''' ExportModel.py - TF-Serving
# Basically we are wrapping your pretrained model
# in a tensorflow serving compatible format.
# This excepts base64 encoded png images and uses
# them as input to your model. Then we convert
# your models output into a png encoded image and
# it gets returned by tensorflow serving base64 encoded.
'''
import tensorflow as tf
mkdir openpubsub
cd openpubsub
curl -s -L https://raw.githubusercontent.com/ZachisGit/OpenPubSub/main/setup.sh -H 'Cache-Control: no-cache, no-store' | sh