Skip to Content
Hands-On Convolutional Neural Networks with TensorFlow
book

Hands-On Convolutional Neural Networks with TensorFlow

by Iffat Zafar, Giounona Tzanidou, Richard Burton, Nimesh Patel, Leonardo Araujo
August 2018
Intermediate to advanced
272 pages
7h 2m
English
Packt Publishing
Content preview from Hands-On Convolutional Neural Networks with TensorFlow

Populating tables in Python

In the following example, we will populate our table, including a field that stores images:

insert_string = """​INSERT INTO tb_drive (id, wheel_angle, acc, image)​ VALUES (%s, %s, %s, %s)​"""​ 
​for data in dataset:​ 
    # Split from dataset the image path, steering angle, and acceleration​ 
    img_path, steering_angle, acc = data​ 
​    # Load image (png compressed)​ 
    with open(img_path, 'rb') as f:​ 
        content_file = f.read()​ 
​ 
    # Insert into database​ 
    session.execute(insert_string,(uuid.uuid1(), steering_angle, acc, content_file))​ 
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Vaibhav Verdhan

Publisher Resources

ISBN: 9781789130331Supplemental Content