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
class MappingLayer(tf.keras.layers.Layer): | |
""" | |
Converts probability outputs to TopN predictions applying a label mapping from indices to ids | |
""" | |
def __init__(self, mapping, topN): | |
super(MappingLayer, self).__init__() | |
initializer = tf.lookup.KeyValueTensorInitializer( | |
keys=tf.range(len(mapping)), | |
values=tf.constant(mapping, tf.int32), |
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
class Base64DecoderLayer(tf.keras.layers.Layer): | |
""" | |
Convert a incoming base 64 string into an bitmap with rgb values between 0 and 1 | |
target_size e.g. [width,height] | |
""" | |
def __init__(self, target_size): | |
self.target_size = target_size | |
super(Base64DecoderLayer, self).__init__() |
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
def _int64_feature(value): | |
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) | |
def _bytes_feature(value): | |
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) | |
for file in valid_files: | |
file_name = os.path.split(file)[1] | |
label = int(os.path.basename(os.path.split(file)[0])) |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |