PymvDB
1.0.0

PYMVDB是一个python库,旨在为图像创建和管理矢量数据库。它具有使用拥抱面部图像特征提取模型作为编码器的能力。
使用Google/VIT-BASE-PATCH16-224-IN21K运行它需要0.41秒来编码我的计算机上的图像(Ryzen 7 2700)
您可以使用PIP安装PYMVDB(即将推出):
pip install pymvdb在等待我在PIP上发布它时,您可以使用以下方式下载并安装PYMVDB:
git clone https://github.com/BBurgarella/PymvDB.git
cd PymvDB
pip install . # Initialize the client with an embedding model
embedding_model = YourEmbeddingModel () # Replace with your actual embedding model
db = Client ( embedding_model , persistent_path = 'database.sqlite' )
# Create a new collection
collection = db . create_collection ( Name = 'my_collection' )
# Add an image to the collection
collection . add_image ( 'path/to/image' , metadata = { "..." })
# Find similar images
target_image = Image . open ( 'path/to/target_image' )
similar_images = collection . find_similar_images ( target_image , top_N = 5 )
print ( similar_images )您可以使用起点文件来运行一个快速示例。这里使用的所有图像都来自Wikipedia
python StartingPoint.py Test_car.jpg