Slide 1

Slide 1 text

C-LIS CO., LTD.

Slide 2

Slide 2 text

C-LIS CO., LTD. ༗ࢁܓೋʢ,FJKJ"3*:"."ʣ C-LIS CO., LTD. AndroidΞϓϦ։ൃऀ ػցֶशॳ৺ऀ ΍ͬͯ·ͤΜ Photo : Koji MORIGUCHI (AUN CREATIVE FIRM)

Slide 3

Slide 3 text

5FOTPS'MPXͰ
 झຯͷը૾ऩूαʔόʔΛ࡞Δ ݄̐߸

Slide 4

Slide 4 text

લճ·Ͱͷ͋Β͢͡

Slide 5

Slide 5 text

޷Έͷ؟ڸ່ͬը૾ΛࣗಈͰऩू͍ͨ͠

Slide 6

Slide 6 text

C-LIS CO., LTD. ࣮ݱΛ્Ή̏ͭͷน σʔλͷน ܭࢉྔͷน ػցֶशͷน

Slide 7

Slide 7 text

C-LIS CO., LTD. $*'"34BNQMF ଟΫϥε෼ྨ IUUQTXXXDTUPSPOUPFEV_LSJ[DJGBSIUNM

Slide 8

Slide 8 text

C-LIS CO., LTD. ̎Ϋϥε෼ྨ 1 0

Slide 9

Slide 9 text

C-LIS CO., LTD. ΍ͬͨ͜ͱ ूΊͨσʔλΛ$*'"3ͷϑΝΠϧܗࣜʹ߹ΘͤͯQBDLͯ͠
 αϯϓϧϓϩάϥϜʹ༩͑ͨ Label Red Green Blue 1 0 Label Red Green Blue 1 Label Red Green Blue 2 :

Slide 10

Slide 10 text

C-LIS CO., LTD. DJGBSQZͷϞσϧ ̎૚ͷંΓ৞ΈɾϓʔϦϯά૚ ̎૚ͷશ݁߹૚

Slide 11

Slide 11 text

C-LIS CO., LTD. ݕূ݁Ռ ܇࿅σʔλ ςετσʔλ 1SFDJTJPO ʙ

Slide 12

Slide 12 text

C-LIS CO., LTD. ՝୊ ֶशʢςετʣσʔλͷॆ࣮
 ؟ڸͰ͸ͳ͘ɺΩϟϥΫλʔΛݟ͍ͯΔՄೳੑ͕͋Δ ൑ఆਫ਼౓Λ্͛Δ
 ʢάϥϑͷਂ૚Խʗύϥϝʔλʔௐ੔ʣ

Slide 13

Slide 13 text

C-LIS CO., LTD. ંΓ৞Έ૚Λ૿΍ͯ͠Έͨ ˍύϥϝʔλʔΛௐ੔ # conv0
 with tf.variable_scope('conv0') as scope:
 kernel = _variable_with_weight_decay('weights', shape=[32, 32, 3, 32],
 stddev=1e-4, wd=0.0)
 conv = tf.nn.conv2d(images, kernel, [1, 1, 1, 1], padding='SAME')
 biases = _variable_on_cpu('biases', [32], tf.constant_initializer(0.0))
 bias = tf.nn.bias_add(conv, biases)
 conv0 = tf.nn.relu(bias, name=scope.name)
 _activation_summary(conv0)
 
 # pool0
 pool0 = tf.nn.max_pool(conv0, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1],
 padding='SAME', name='pool0')
 # norm0
 norm0 = tf.nn.lrn(pool0, 4, bias=1.0, alpha=0.001 / 9.0, beta=0.75,
 name='norm0')
 
 # conv1
 with tf.variable_scope('conv1') as scope:
 kernel = _variable_with_weight_decay('weights', shape=[16, 16, 32, 64],
 stddev=1e-4, wd=0.0)
 conv = tf.nn.conv2d(norm0, kernel, [1, 1, 1, 1], padding='SAME')
 biases = _variable_on_cpu('biases', [64], tf.constant_initializer(0.0))
 bias = tf.nn.bias_add(conv, biases)
 conv1 = tf.nn.relu(bias, name=scope.name)
 _activation_summary(conv1)

Slide 14

Slide 14 text

C-LIS CO., LTD. ݕূσʔλͷ෼ྨΛखͰߦ͏ ҰຕֆͷΩϟϥΫλʔʹݶఆ͢Δ
 ʢෳ਺ຕଘࡏ͠ʹ͍͘ֆΛબఆʣ D ࠜઇΕ͍

Slide 15

Slide 15 text

C-LIS CO., LTD. ΅͔͠ Ψ΢γΞϯϊΠζ ΠϯύϧεϊΠζ ܇࿅σʔλը૾ʹϊΠζΛՃ͑ͯ૿ྔ

Slide 16

Slide 16 text

C-LIS CO., LTD. ܇࿅σʔλը૾ʹϊΠζΛՃ͑ͯ૿ྔ

Slide 17

Slide 17 text

C-LIS CO., LTD. ݕূʢ৽Ϟσϧʴ৽σʔληοτʣ ܇࿅σʔλ ςετσʔλ 1SFDJTJPO ʙ

Slide 18

Slide 18 text

C-LIS CO., LTD. 5SBJOJOHʢ৽Ϟσϧʴ৽σʔληοτʣ CBUDI 4UFQ

Slide 19

Slide 19 text

C-LIS CO., LTD. ݕূʢچϞσϧʴ৽σʔληοτʣ ܇࿅σʔλ ςετσʔλ 1SFDJTJPO ʙ

Slide 20

Slide 20 text

C-LIS CO., LTD. ՝୊ ֶशʢςετʣσʔλʹదԠ͢ΔϑΟϧλʔͷ
 छྨͱڧ౓Λݕ౼ ൑ఆਫ਼౓Λ্͛Δɹˠɹ$*'"3ͷσʔλͰ֬ೝ
 ʢάϥϑͷਂ૚Խʗύϥϝʔλʔௐ੔ʗޡ൑ఆύλʔϯΛׂΓग़͢ʣ

Slide 21

Slide 21 text

5FOTPS'MPXͰ ը૾ϑΝΠϧΛಡΈࠐΉ

Slide 22

Slide 22 text

C-LIS CO., LTD. $*'"3ܗࣜͷ໰୊ αΠζ͕େ͖͍ʢ࣮࣭#JUNBQʣ σʔλͷ௥Ճ΍Ұ෦࡟আ͕೉͍͠ Label Red Green Blue 1 0 Label Red Green Blue 1 Label Red Green Blue 2 :

Slide 23

Slide 23 text

ը૾ϑΝΠϧΛ௚઀ಡΈࠐΉ

Slide 24

Slide 24 text

C-LIS CO., LTD. ݱࡏͷݩը૾ +1&(PS1/(ܗࣜ إͷ෦෼Λ0QFO$7Ͱ൑ఆͯ͠੾Γൈ͖ ը૾ͷαΠζ͸όϥόϥʢਖ਼ํܗʣ ಉ͡αΠζʹ౷Ұ͢Δ ϑΟϧλʔͷద༻

Slide 25

Slide 25 text

C-LIS CO., LTD. ը૾ΛಡΜͰʮදࣔʯ͢Δ def load_png_images(label, filename_queue, size=96, depth=3):
 reader = tf.WholeFileReader()
 key, value = reader.read(filename_queue)
 
 result = ImageData()
 result.label = label
 
 decoded_png = tf.image.decode_png(value)
 decoded_png = tf.image.resize_images(decoded_png, size, size)
 
 result.image = decoded_png
 result.width = size
 result.height = size
 result.depth = depth
 
 return result

Slide 26

Slide 26 text

C-LIS CO., LTD. ը૾ΛಡΜͰʮදࣔʯ͢Δ def _read_image(label, path_list):
 filename_queue = tf.train.string_input_producer(path_list)
 image_result = megane_input.load_png_images(label, filename_queue)
 
 # ը૾Լॲཧ
 # image_result.distort()
 
 return image_result


Slide 27

Slide 27 text

C-LIS CO., LTD. ը૾ΛϥϯμϜͰՃ޻͢Δ def distort(self, max_delta=60, contrast_lower=0.2, contrast_upper=2.8):
 # ͘Γൈ͖Λ͢ΔྖҬΛܭࢉ
 self.height = int(self.height * 0.8)
 self.width = int(self.width * 0.8)
 
 distorted_image = tf.cast(self.image, tf.float32)
 distorted_image = tf.random_crop(distorted_image, [self.height, self.width, self.depth])
 distorted_image = tf.image.random_flip_left_right(distorted_image)
 distorted_image = tf.image.random_brightness(distorted_image, max_delta=max_delta)
 distorted_image = tf.image.random_contrast(distorted_image, lower=contrast_lower, upper=contrast_upper)
 
 self.image = distorted_image
 
 # ແޮԽ͓ͯ͘͠
 # self.image = tf.image.per_image_whitening(self.image)


Slide 28

Slide 28 text

C-LIS CO., LTD. ը૾ΛಡΜͰʮදࣔʯ͢Δ def _show_images(target_dir):
 files = gfile.ListDirectory(target_dir, False)
 files = filter(lambda file: file.endswith('.png'), files)
 path_list = list(map(lambda file: target_dir + file, files))
 
 image = _read_image(-1, path_list)
 
 init_op = tf.initialize_all_variables()
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(coord=coord)
 
 for i in range(len(path_list)):
 image_raw = image.image.eval()
 Image.fromarray(np.asarray(image_raw).astype(np.uint8)).show()
 
 coord.request_stop()
 coord.join(threads)

Slide 29

Slide 29 text

EFNP

Slide 30

Slide 30 text

C-LIS CO., LTD. େ͖ͳಾ͕ʜʜ def _show_images(target_dir):
 files = gfile.ListDirectory(target_dir, False)
 files = filter(lambda file: file.endswith('.png'), files)
 path_list = list(map(lambda file: target_dir + file, files))
 
 image = _read_image(-1, path_list)
 
 init_op = tf.initialize_all_variables()
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(coord=coord)
 
 for i in range(len(path_list)):
 image_raw = image.image.eval()
 Image.fromarray(np.asarray(image_raw).astype(np.uint8)).show()
 
 coord.request_stop()
 coord.join(threads)

Slide 31

Slide 31 text

ը૾ʹ෇͚Δʮϥϕϧʯ͸ Ͳ͏΍ͬͯ؅ཧ͢Δʁ

Slide 32

Slide 32 text

C-LIS CO., LTD. ϥϕϧ 1 0

Slide 33

Slide 33 text

C-LIS CO., LTD. $*'"3ܗࣜ Label Red Green Blue 1 0 Label Red Green Blue 1 Label Red Green Blue 2 :

Slide 34

Slide 34 text

C-LIS CO., LTD. σʔλܗࣜ ݻఆ௕Ϩίʔυʢ$*'"3ʣ $47ܗࣜ 5'3FDPSEܗࣜ IUUQTXXXUFOTPSqPXPSHWFSTJPOTSIPX@UPTSFBEJOH@EBUB JOEFYIUNMSFBEJOHEBUB

Slide 35

Slide 35 text

C-LIS CO., LTD. 5'3FDPSEܗࣜ Α͏͢Δʹ1SPUPDPM#V⒎FSTͰ͢

Slide 36

Slide 36 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷॻ͖ग़͠ 5'3FDPSE8SJUFSΛ࢖͏ ϓϩτίϧఆٛʢUGUSBJO&YBNQMFʣʹσʔλߏ଄Λ هड़͢Δ IUUQTHJUIVCDPNUFOTPSqPXUFOTPSqPXCMPCSUFOTPSqPXFYBNQMFT IPX@UPTSFBEJOH@EBUBDPOWFSU@UP@SFDPSETQZ

Slide 37

Slide 37 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷॻ͖ग़͠ class ImageData: def save_tfrecord(self, base_filename):
 with tf.python_io.TFRecordWriter(base_filename + ".tfrecord") as writer:
 example = tf.train.Example(features=tf.train.Features(feature={
 'file_name': _bytes_feature(os.path.basename(self.filename).encode()),
 'label': _int64_feature(self.label),
 'image': _bytes_feature(self.image),
 'height': _int64_feature(self.height),
 'width': _int64_feature(self.width),
 'depth': _int64_feature(self.depth),
 }))
 writer.write(example.SerializeToString())


Slide 38

Slide 38 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷॻ͖ग़͠ def _convert_image_to_tfrecords(label, file):
 print("Processing... " + file)
 
 value = None
 width = -1
 height = -1
 
 with Image.open(file) as img:
 width = img.width
 height = img.height
 
 with open(file, "rb") as image:
 value = image.read()
 image.close()
 
 result = ImageData()
 result.filename = file
 result.label = label
 result.image = value
 result.height = height
 result.width = width
 result.depth = 3
 
 result.save_tfrecord(file)

Slide 39

Slide 39 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷಡΈࠐΈ 5'3FDPSE3FBEFSΛ࢖͏ pMF@RVFVFΛ༩͑ΔͱɺEJDUܕͷσʔλ͕ಘΒΕΔ IUUQTHJUIVCDPNUFOTPSqPXUFOTPSqPXCMPCSUFOTPSqPXFYBNQMFT IPX@UPTSFBEJOH@EBUBGVMMZ@DPOOFDUFE@SFBEFSQZ

Slide 40

Slide 40 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷಡΈࠐΈ def _read_image_from_tfrecord(path_list):
 filename_queue = tf.train.string_input_producer(path_list)
 
 reader = tf.TFRecordReader()
 _, serialized_example = reader.read(filename_queue)
 
 features = tf.parse_single_example(
 serialized_example,
 features={
 'file_name': tf.FixedLenFeature([], tf.string),
 'label': tf.FixedLenFeature([], tf.int64),
 'image': tf.FixedLenFeature([], tf.string),
 'height': tf.FixedLenFeature([], tf.int64),
 'width': tf.FixedLenFeature([], tf.int64),
 'depth': tf.FixedLenFeature([], tf.int64),
 })
 
 image_data = ImageData()
 image_data.set_from_features(features)
 
 return image_data

Slide 41

Slide 41 text

C-LIS CO., LTD. 5'3FDPSEܗࣜͷಡΈࠐΈ def set_from_features(self, features):
 self.filename = features['file_name']
 self.label = features['label']
 self.filename = tf.image.decode_png(features['image']) self.height = features['height']
 self.width = features['width']
 self.depth = features['depth']


Slide 42

Slide 42 text

C-LIS CO., LTD. 5'3FDPSEͷදࣔ def _view_tfrecord(path):
 files = filter(lambda file: file.endswith('.tfrecord'), gfile.ListDirectory(path, False))
 path_list = list(map(lambda file: path + file, files))
 
 image_data = _read_image_from_tfrecord(path_list)
 
 init_op = tf.initialize_all_variables()
 
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(path_list)):
 image = image_data.image
 Image.fromarray(image).show()
 finally:
 coord.request_stop()
 coord.join(threads)

Slide 43

Slide 43 text

C-LIS CO., LTD. ಈ͖·ͤΜ Traceback (most recent call last): File "/Users/keiji_ariyama/PycharmProjects/megane_co/src/megane_co/tfrecord_viewer.py", line 80, in main(sys.argv) File "/Users/keiji_ariyama/PycharmProjects/megane_co/src/megane_co/tfrecord_viewer.py", line 76, in main _view_tfrecord(target_dir) File "/Users/keiji_ariyama/PycharmProjects/megane_co/src/megane_co/tfrecord_viewer.py", line 64, in _view_tfrecord Image.fromarray(image_data.image).show() File "/Users/keiji_ariyama/python_virtualenv/tensorflow/lib/python3.5/site-packages/PIL/ Image.py", line 2154, in fromarray arr = obj.__array_interface__ AttributeError: 'Tensor' object has no attribute '__array_interface__' Process finished with exit code 1

Slide 44

Slide 44 text

C-LIS CO., LTD. JNBHF@EBUBJNBHFͷ಺༰Λදࣔ Tensor("DecodePng:0", shape=(?, ?, ?), dtype=uint8)

Slide 45

Slide 45 text

C-LIS CO., LTD. FWBM ͢Δͱʜʜ def _view_tfrecord(path):
 files = filter(lambda file: file.endswith('.tfrecord'), gfile.ListDirectory(path, False))
 path_list = list(map(lambda file: path + file, files))
 
 image_data = _read_image_from_tfrecord(path_list)
 
 init_op = tf.initialize_all_variables()
 
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(path_list)):
 image = image_data.image.eval()
 Image.fromarray(image).show()
 finally:
 coord.request_stop()
 coord.join(threads)

Slide 46

Slide 46 text

EFNP

Slide 47

Slide 47 text

C-LIS CO., LTD. ֤஋͕ਖ਼ৗʹಡΊ͍ͯΔ͔֬ೝ class ImageData: def print(self):
 result = str(self.filename.eval())
 result += ' '
 result += str(self.label.eval())
 result += ' '
 result += str(self.height.eval())
 result += ' '
 result += str(self.width.eval())
 result += ' '
 result += str(self.depth.eval())
 
 print(result)


Slide 48

Slide 48 text

C-LIS CO., LTD. ֤஋͕ਖ਼ৗʹಡΊ͍ͯΔ͔֬ೝ def _view_tfrecord(path):
 files = filter(lambda file: file.endswith('.tfrecord'), gfile.ListDirectory(path, False))
 files_full_path = list(map(lambda file: path + file, files))
 
 image_data = _read_image_from_tfrecord(files_full_path)
 
 init_op = tf.initialize_all_variables()
 
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(files_full_path)):
 image_data.print()
 image = image_data.image
 Image.fromarray(image).show()
 finally:
 coord.request_stop()
 coord.join(threads)


Slide 49

Slide 49 text

C-LIS CO., LTD. ໰୊ൃੜ b'anzu_joy01_0.png' 1 368 650 3 b'anzu_joy01_0.png' 1 368 650 3 b'haruki_joy01_0.png' 1 650 368 3 b'anzu_joy01_0.png' 1 368 650 3 ຊདྷͱҧ͏஋͕දࣔ͞Ε͍ͯΔ

Slide 50

Slide 50 text

C-LIS CO., LTD. ௐࠪΛଓ͚Δͱʜʜ ϑΝΠϧҰͭͷͱ͖͸ਖ਼͍͠஋͕ݟ͍͑ͯΔ ඇಉظͷ໰୊ʁ

Slide 51

Slide 51 text

C-LIS CO., LTD. ͓͞Β͍ 5FOTPS'MPX͸ɺ4FTTJPOͷதͰॲཧʢ0QFSBUJPOʣΛ
 ϋϯυϦϯά͢Δ TFTTJPOSVO͢Δ·Ͱ͸ɺ͢΂ͯͷ஋͸࣮ମΛ࣋ͨͳ͍ Tensor("DecodePng:0", shape=(?, ?, ?), dtype=uint8) IUUQTXXXUFOTPSqPXPSHWFSTJPOTSHFU@TUBSUFECBTJD@VTBHFIUNM

Slide 52

Slide 52 text

C-LIS CO., LTD. ηογϣϯ def _view_tfrecord(path):
 files = filter(lambda file: file.endswith('.tfrecord'), gfile.ListDirectory(path, False))
 files_full_path = list(map(lambda file: path + file, files))
 
 image_data = _read_image_from_tfrecord(files_full_path)
 
 init_op = tf.initialize_all_variables()
 
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(files_full_path)):
 image_data.print()
 image = image_data.image
 Image.fromarray(image).show()
 finally:
 coord.request_stop()
 coord.join(threads)


Slide 53

Slide 53 text

C-LIS CO., LTD. ΦϖϨʔγϣϯɾάϥϑ … file4 file3 file2 file1 filename_queue TFRecordReader decode_png Tensor("DecodePng:0", shape=(?, ?, ?), dtype=uint8)

Slide 54

Slide 54 text

C-LIS CO., LTD. ΦϖϨʔγϣϯɾάϥϑ … file4 file3 file2 file1 filename_queue TFRecordReader decode_png resize_image Tensor("Squeeze:0", shape=(96, 96, ?), dtype=float32)

Slide 55

Slide 55 text

C-LIS CO., LTD. file1 TFRecordReader decode_png resize_image file1 TFRecordReader decode_png resize_image ධՁʢ࣮ߦʣ … file4 file3 file2 filename_queue resize_image resize_image .eval() or session.run( )

Slide 56

Slide 56 text

C-LIS CO., LTD. ηογϣϯ def _view_tfrecord(path):
 files = filter(lambda file: file.endswith('.tfrecord'), gfile.ListDirectory(path, False))
 files_full_path = list(map(lambda file: path + file, files))
 
 image_data = _read_image_from_tfrecord(files_full_path)
 
 init_op = tf.initialize_all_variables()
 
 with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(files_full_path)):
 image = image_data.image.eval()
 Image.fromarray(image).show()
 finally:
 coord.request_stop()
 coord.join(threads)


Slide 57

Slide 57 text

C-LIS CO., LTD. .eval() or session.run( ) feature['file_name'] feature['file_name'] ̍౓໨ͷධՁʢ࣮ߦʣ … file4 file3 file2 filename_queue file1 TFRecordReader feature['file_name']

Slide 58

Slide 58 text

C-LIS CO., LTD. feature['file_name'] feature['file_name'] file1 ̎౓໨ͷධՁʢ࣮ߦʣ … file4 file3 file2 filename_queue TFRecordReader feature['file_name'] .eval() or session.run( ) file2

Slide 59

Slide 59 text

C-LIS CO., LTD. FWBM ͝ͱʹ2VFVF͕ਐΉ def print(self):
 result = str(self.filename.eval())
 result += ' '
 result += str(self.label.eval())
 result += ' '
 result += str(self.height.eval())
 result += ' '
 result += str(self.width.eval())
 result += ' '
 result += str(self.depth.eval())
 
 print(result)


Slide 60

Slide 60 text

C-LIS CO., LTD. ͳͥؾͮ͘ͷ͕஗Εͨͷ͔ pMF@RVFVFΛ࡞੒͢ΔTUSJOH@JOQVU@QSPEVDFSؔ਺ͷ Ҿ਺TIV⒐Fͷॳظ஋͕5SVF filename_queue = tf.train.string_input_producer(path_list, shuffle=True) IUUQTXXXUFOTPSqPXPSHWFSTJPOTSBQJ@EPDTQZUIPO JP@PQTIUNMTUSJOH@JOQVU@QSPEVDFS

Slide 61

Slide 61 text

Ͳ͏͢Ε͹͍͍͔

Slide 62

Slide 62 text

C-LIS CO., LTD. ॲཧ͸0QFSBUJPOʹด͡ࠐΊΔ with tf.Session() as sess:
 sess.run(init_op)
 
 coord = tf.train.Coordinator()
 threads = tf.train.start_queue_runners(sess=sess, coord=coord)
 
 try:
 for i in range(len(files_full_path)):
 square = tf.mul(image_data.width, image_data.height)
 print(square.eval())
 
 finally:
 coord.request_stop()
 coord.join(threads) 135424 <- 368 * 368 422500 <- 650 * 650

Slide 63

Slide 63 text

C-LIS CO., LTD. mul mul file1 TFRecordReader feature['width'] mul ධՁʢ࣮ߦʣ … file4 file3 file2 filename_queue .eval() or session.run( ) feature['height'] 422500

Slide 64

Slide 64 text

C-LIS CO., LTD. ͳͥॻ͖ग़͠͸໰୊ͳ͔ͬͨͷ͔ 5'3FDPSE8SJUFS͸TFTTJPOͷ؅ཧԼʹͳ͍ def save_tfrecord(self, base_filename):
 with tf.python_io.TFRecordWriter(base_filename + ".tfrecord") as writer:
 example = tf.train.Example(features=tf.train.Features(feature={
 'file_name': _bytes_feature(os.path.basename(self.filename).encode()),
 'label': _int64_feature(self.label),
 'image': _bytes_feature(self.image),
 'height': _int64_feature(self.height),
 'width': _int64_feature(self.width),
 'depth': _int64_feature(self.depth),
 }))
 writer.write(example.SerializeToString())


Slide 65

Slide 65 text

C-LIS CO., LTD. 5'3FDPSE8SJUFSͱ3FBEFSͷҧ͍ʹ஫ҙ def _read_image_from_tfrecord(path_list):
 filename_queue = tf.train.string_input_producer(path_list)
 
 reader = tf.TFRecordReader()
 _, serialized_example = reader.read(filename_queue)
 
 features = tf.parse_single_example(
 serialized_example,
 features={
 'file_name': tf.FixedLenFeature([], tf.string),
 'label': tf.FixedLenFeature([], tf.int64),
 'image': tf.FixedLenFeature([], tf.string),
 'height': tf.FixedLenFeature([], tf.int64),
 'width': tf.FixedLenFeature([], tf.int64),
 'depth': tf.FixedLenFeature([], tf.int64),
 })
 
 image_data = ImageData()
 image_data.set_from_features(features)
 
 return image_data

Slide 66

Slide 66 text

C-LIS CO., LTD. ·ͱΊ 5FOTPS'MPXͷॲཧ͸0QFSBUJPOʹด͡ࠐΊΔ FWBM ΍TFTTSVOΛ͢ΔҙຯΛ͖ͪΜͱೝࣝ͢Δ
 ʢQSJOUจͷσόοά͸μϝʂɹθολΠʂʣ 5FOTPS#PBSEͱ͔͕࢖͑ΔΜ͡Όͳ͍͔ͳ

Slide 67

Slide 67 text

C-LIS CO., LTD. ࣍ճ༧ࠂ ݄೔ɹٕज़ॻΦϯϦʔΠϕϯτ ʮٕज़ॻయʯʢ౰બ͍ͯ͠Ε͹ʣ ʮ5FOTPS'MPXͷബ͍ຊʢԾʣʯ IUUQTUFDICPPLGFTUHJUIVCJP

Slide 68

Slide 68 text

C-LIS CO., LTD. 5FOTPS'MPXΛ࢖ͬͨػցֶश͜ͱ͸͡ΊCZ5PSV6&/0:"."
 IUUQXXXTMJEFTIBSFOFU5PSV6FOPZBNBUFOTPSqPXHEH
 
 5FOTPS'MPX
 IUUQTHJUIVCDPNUFOTPSqPXUFOTPSqPX ࢀߟ

Slide 69

Slide 69 text

C-LIS CO., LTD. C-LIS CO., LTD.

Slide 70

Slide 70 text

ຊࢿྉ͸ɺ༗ݶձࣾγʔϦεͷஶ࡞෺Ͱ͢ɻܝࡌ͞Ε͍ͯΔΠϥετ͸ɺಛʹهࡌ͕ͳ͍৔߹͸ࠜઇΕ͍ͷஶ࡞෺Ͱ͢ɻ ຊࢿྉͷશ෦ɺ·ͨ͸Ұ෦ʹ͍ͭͯɺஶ࡞ऀ͔ΒจॻʹΑΔڐ୚Λಘͣʹෳ੡͢Δ͜ͱ͸ې͡ΒΕ͍ͯ·͢ɻ 5IF"OESPJE4UVEJPJDPOJTSFQSPEVDFEPSNPEJpFEGSPNXPSLDSFBUFEBOETIBSFECZ(PPHMFBOEVTFE BDDPSEJOHUPUFSNTEFTDSJCFEJOUIF$SFBUJWF$PNNPOT"UUSJCVUJPO-JDFOTF ֤੡඼໊ɾϒϥϯυ໊ɺձ໊ࣾͳͲ͸ɺҰൠʹ֤ࣾͷ঎ඪ·ͨ͸ొ࿥঎ඪͰ͢ɻຊࢿྉதͰ͸ɺ˜ɺšɺäΛׂѪͯ͠ ͍·͢ɻ 5IF"OESPJESPCPUJTSFQSPEVDFEPSNPEJpFEGSPNXPSLDSFBUFEBOETIBSFECZ(PPHMFBOEVTFEBDDPSEJOH UPUFSNTEFTDSJCFEJOUIF$SFBUJWF$PNNPOT"UUSJCVUJPO-JDFOTF