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