@@ -41,9 +41,6 @@ def build_network(self):
41
41
self .gender = tf .placeholder (tf .float32 , [self .batch_size ,2 ], name = 'gender' )
42
42
43
43
44
-
45
- self .X = self .load_from_tfRecord (self .filename_queue ,resize_size = (self .img_width ,self .img_height ))
46
-
47
44
theta = self .localization_squeezenet (self .X )
48
45
self .T_mat = tf .reshape (theta , [- 1 , 2 ,3 ])
49
46
self .cropped = transformer (self .X , self .T_mat , [self .out_height , self .out_width ])
@@ -87,6 +84,14 @@ def train(self):
87
84
88
85
print self .sess .run (self .T_mat , feed_dict = {self .X : np .random .randn (self .batch_size , self .img_height , self .img_width , self .channel )})
89
86
87
+ images = self .load_from_tfRecord (self .filename_queue )
88
+
89
+ coord = tf .train .Coordinator ()
90
+ threads = tf .train .start_queue_runners (sess = self .sess , coord = coord )
91
+
92
+ for i in xrange (2 ):
93
+ img_batch = self .sess .run (images )
94
+ print img_batch .shape
90
95
91
96
92
97
def hyperface (self ,inputs , reuse = False ):
@@ -238,7 +243,6 @@ def predict(self, imgs_path):
238
243
239
244
brk ()
240
245
241
-
242
246
def load_from_tfRecord (self ,filename_queue ,resize_size = None ):
243
247
244
248
reader = tf .TFRecordReader ()
@@ -258,13 +262,15 @@ def load_from_tfRecord(self,filename_queue,resize_size=None):
258
262
259
263
image_shape = tf .pack ([orig_height ,orig_width ,3 ])
260
264
image_tf = tf .reshape (image ,image_shape )
261
-
265
+ print image_shape
262
266
resized_image = tf .image .resize_image_with_crop_or_pad (image_tf ,target_height = resize_size [1 ],target_width = resize_size [0 ])
263
267
264
268
images = tf .train .shuffle_batch ([resized_image ],batch_size = self .batch_size ,num_threads = 1 ,capacity = 50 ,min_after_dequeue = 10 )
265
269
266
270
return images
267
271
272
+
273
+
268
274
def load_weights (self , path ):
269
275
variables = slim .get_model_variables ()
270
276
print 'Loading weights...'
0 commit comments