def test_batch(self):
with self.test_session() as sess:
df = pd.DataFrame(
['TQ2379_0_0_B TQ2379_0_0.jpg F 1776:520|1824:125'.split(),
'TQ2379_0_0_B TQ2379_0_0.jpg F 1776:500|1824:125'.split(),
],
columns=['id', 'image', 'class', 'detections'])
df = extract_crops_sw(df, 250, False, 250)
batch = create_batch(df, False)
tf.global_variables_initializer().run()
tf.local_variables_initializer().run()
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
images, labels = sess.run(batch)
self.assertListEqual(list(labels[0, 2, 3, :5]),
[1., 74., 125., 30., 30.])
self.assertTrue(labels[0, 2, 3, 5 + 5])
coord.request_stop()
coord.join(threads)
tests.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录