本文主要是介绍Python操作sqlite3数据库--增删改查,利用sqlite3实现轻量级图像搜索底库,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
1.普通版本
2.优化加速版本1--数据库文件加载到内存中
3.优化加速版本2--多线程实现for循环
1.普通版本
#coding=utf8
import sqlite3
import os
import numpy as np#下面十个特征值仅用来做测试,
feature0 = [-4.382546,-1.907722,3.957601,-1.649950,2.271955,-3.160072,-3.399295,-9.906655,-2.748945,4.792392,-1.652369,-5.804037,-4.493183,4.631711,-7.879868,-5.704821,-0.437358,1.886370,-1.807799,-7.712604,-9.373422,-1.501428,4.547236,-4.306746,-3.834078,0.200928,9.269361,-0.823282,4.501956,-3.782048,3.471190,-4.361027,-1.006232,-1.262225,-5.400513,2.865177,-1.876402,-4.880475,-8.805721,-10.455149,9.418224,-6.131712,1.266349,-9.258633,-4.059271,-8.922170,0.830297,2.685555,0.500101,-4.347172,-8.808794,5.587566,-0.607917,0.788026,-0.957420,3.033850,0.910840,-5.942140,-9.012087,-0.547222,5.770831,9.508060,-5.271891,-6.065019,-5.419050,2.295368,-3.9
这篇关于Python操作sqlite3数据库--增删改查,利用sqlite3实现轻量级图像搜索底库的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!