1 2 3 4 5 6 7 8 9 10 11 12
| import sqlite3 sqlite_file = "./db.sqlite" conn = sqlite3.connect(sqlite_file) c = conn.cursor() cmd = "DROP TABLE {table_name}".format(table_name=cfg.table_name) c.execute(cmd) cmd = 'CREATE TABLE {table_name} ({image} {image_dt}, {render} {render_dt}, {label} {label_dt}, {predict} {predict_dt}, {miou} {miou_dt})'.format(table_name=cfg.table_name, image="image", image_dt='TEXT', render='render', render_dt="TEXT", label="label", label_dt="TEXT", predict="predict", predict_dt="TEXT", miou="miou", miou_dt="REAL") c.execute(cmd) cmd = "INSERT INTO {table_name} (image, render, label, predict, miou) VALUES('{image}', '{render}', '{label}', '{predict}', {miou})".format(table_name=table_name, image=image, render=render, label=label, predict=predict, miou=miou) c.execute(cmd) conn.commit() conn.close()
|