sthalles / face-similarity Goto Github PK
View Code? Open in Web Editor NEWFace-similarity CNN using Tensorflow Eager execution.
Face-similarity CNN using Tensorflow Eager execution.
Thank you for your share.
I got a problem when I run it with my own data.
I make bmp files to tfrecords with code below:
import tensorflow as tf
import cv2
import numpy as np
datalistfile = './images/data'
''' format of datalistfile
0 ./images/cgh_0.bmp ./images/cgh_10.bmp
0 ./images/cgh_10.bmp ./images/cgh_11.bmp
'''
dataf = open(datalistfile,'r')
writer = tf.python_io.TFRecordWriter("test.tfrecords")
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]))
data = dataf.readlines()
for i in range(len(data)):
line = data[i]
line = line.strip()
line = line.split(" ")
Xi = tf.gfile.FastGFile(line[1], 'rb').read() # image data type is string
Xj = tf.gfile.FastGFile(line[2], 'rb').read() # image data type is string
image_shape = cv2.imread(line[1]).shape
width = image_shape[1]
height = image_shape[0]
label = int(line[0])
features = {
'Xi': _bytes_feature(Xi),
'Xj': _bytes_feature(Xj),
"label": _int64_feature(label),
"height": _int64_feature(height),
"width": _int64_feature(width)
}
example = tf.train.Example(features = tf.train.Features(feature=features))
writer.write(example.SerializeToString())
writer.close()
So , can you tell me how do you make your test_v2.tfrecords from images?
Hello i'm having some problems with your pynb :
'BatchDataset' object is not iterable
What is the tensorflow version needed ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.