# Path: moonlight/glyphs/corpus.py
# def get_patch_shape(corpus_file):
# def parse_corpus(corpus_file, height, width):
# 
# Path: moonlight/glyphs/knn_model.py
# K_NEAREST_VALUE = 3
# NUM_GLYPHS = len(musicscore_pb2.Glyph.Type.keys())
# def knn_kmeans_model(centroids, labels, patches=None):
# def _to_uint8(values):
# def _to_float(values_t):
# def export_knn_model(centroids, labels, export_path):
# def _squared_euclidean_distance_matrix(a, b):


from absl import app
from moonlight.glyphs import corpus
from moonlight.glyphs import knn_model
import tensorflow as tf
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tool to convert existing KNN tfrecords to a saved model."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




def run(tfrecords_filename, export_dir):
  with tf.Session():
    height, width = corpus.get_patch_shape(tfrecords_filename)

# Path: moonlight/glyphs/corpus.py
# def get_patch_shape(corpus_file):
# def parse_corpus(corpus_file, height, width):
# 
# Path: moonlight/glyphs/knn_model.py
# K_NEAREST_VALUE = 3
# NUM_GLYPHS = len(musicscore_pb2.Glyph.Type.keys())
# def knn_kmeans_model(centroids, labels, patches=None):
# def _to_uint8(values):
# def _to_float(values_t):
# def export_knn_model(centroids, labels, export_path):
# def _squared_euclidean_distance_matrix(a, b):


# Path: moonlight/tools/export_kmeans_centroids.py
from absl import app
from moonlight.glyphs import corpus
from moonlight.glyphs import knn_model
import tensorflow as tf

# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tool to convert existing KNN tfrecords to a saved model."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function




def run(tfrecords_filename, export_dir):
  with tf.Session():
    height, width = corpus.get_patch_shape(tfrecords_filename)

    patches, labels = corpus.parse_corpus(tfrecords_filename, height, width)