# 图搜 **Repository Path**: windyzone/imagesearch ## Basic Information - **Project Name**: 图搜 - **Description**: 以图搜图 - **Primary Language**: Go - **License**: 0BSD - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-04-22 - **Last Updated**: 2025-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 图搜 #### 介绍 以图搜图 #### 软件架构 ![输入图片说明](https://foruda.gitee.com/images/1711454672683100785/1e627c2d_1892760.jpeg "图搜.jpg") #### 使用说明 ##### 添加图像 1.这里是列表文本集成服务 将图片保存到本地,并将图片push到使用zimg搭建的图床容器服务中,zimg返回一个图片url. 2. 这里是列表文本将图片插入到vearch_plugin中,插入支持本地图片和url图片。本地图片需要指定图片在vearch_plugin中的位置。因此1中集成服务保存本地的位置为vearch_plugin卷映射的位置。 3. 这里是列表文本verach_plugin 使用服务内部自带的特征向量,计算图片的特征,并将特征向量值和标量(建space时如果有)插入到verach数据库。 ##### 搜索图像 1. 这里是列表文本搜索图像,集成服务 收到用户上传的图像后,保存到本地(位置是vearch_plugin的映射位置) 2. 这里是列表文本:调用vearch_plugin搜索接口 查询,返回匹配到的URL数据。 #### 建space内容: PUT http://127.0.0.1:4102/space/zhijie_tuku/_create ``` { "name": "zhijie_image", "partition_num": 1, "replica_num": 1, "engine": { "index_size": 1, "retrieval_type": "IVFPQ", "retrieval_param": { "metric_type": "InnerProduct", "ncentroids": -1, "nsubvector": -1 } }, "properties": { "url": { "type": "keyword", "index": true }, "name": { "type": "string", "index": true }, "feature1": { "type": "vector", "dimension": 512, "format": "normalization" } } } ``` #### docker-compose.yml文件内容 ``` version: '3.3' services: vearch: image: vearch/vearch:latest ports: - "8817:8817" - "9001:9001" volumes: - /home/vearch/config_plugin.toml:/vearch/config.toml - /home/vearch/data:/datas - /home/vearch/logs:/logs logging: driver: "json-file" options: max-size: "1g" vearch-plugin: image: haojunyu/vimgs:3.2.2 ports: - "4102:4101" volumes: - /home/vearch/python-algorithm-plugin/src/config.py:/app/src/config.py - /home/vearch/images/imgs:/app/src/imgs command: ["bash", "../bin/run.sh", "image"] zhijie_zimg: image: iknow0612/zimg:latest ports: - "4869:4869" volumes: - /home/vearch/img_data:/zimg/bin/img command: ["bash", "app.sh"] ```