This demo is an updated version of the original image search system, replacing the original image feature extraction model VGG with Resnet 50, adding the target detection function for images, and then building a reverse image search system in combination with Milvus.
The system architecture is shown below.
The following tables show recommended configurations for reverse image search. These configurations haven been tested.
Component | Recommended Configuration |
---|---|
CPU | Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz |
Memory | 32GB |
OS | Ubuntu 18.04 |
Software | Milvus 0.10.5 pic_search_webclient 0.2.0<br / |
This demo uses the PASCAL VOC image set, which contains 17125 images with 20 categories: human; animals (birds, cats, cows, dogs, horses, sheep); transportation (planes, bikes,boats, buses, cars, motorcycles, trains); household (bottles, chairs, tables, pot plants, sofas, TVs)
Dataset size: ~ 2 GB.
Download location: https://pan.baidu.com/s/1MjACqsGiLo3oiTMcxodtdA extraction code: v78m
Note: You can also use other images for testing. This system supports the following formats: .jpg and .png.
This demo uses Milvus 0.10.5. Refer to the Install Milvus for how to run Milvus docker.
cd /image_search/webserver
pip install -r requirements.txt
vim /image_search_v2/webserver/src/common/config.py
Need to modify the milvus port or milvus ip parameters corresponding to the Milvus installation
Parameter | Description | Default setting |
---|---|---|
MILVUS_HOST | milvus service ip | 127.0.0.1 |
MILVUS_PORT | milvus service port | 19512 |
VECTOR_DIMENSION | Dimensionality of the vectors | 2048 |
DATA_PATH | Path to save images | /data/jpegimages |
DEFAULT_TABLE | The milvus default collection | milvus_183 |
UPLOAD_PATH | Storage path for uploaded images | /tmp/search-images |
COCO_MODEL_PATH | Path of the target detection model | /yolov3_detector/data/yolov3_darknet |
YOLO_CONFIG_PATH | Profile path for target detection model | /yolov3_detector/data/yolov3_darknet/yolo.yml |
cd /image_search/webserver/src
python app.py
If your yolo model is not downloaded automatically, you need to go to the image_search_v2/webserver/src/yolov3_detector/data/ path and run the paprepare_model.sh script
$ docker run --name zilliz_search_images_demo_web -d --rm -p 8001:80 \
-e API_URL=http://${WEBSERVER_IP}:5000 \
milvusbootcamp/pic-search-webclient:0.2.0
In the previous command, WEBSERVER_IP specifies the server IP address that runs pic-search-webserver docker.
After deployment, enter ${WEBCLIENT_IP}:8001
in the browser to open the interface for reverse image search. WEBCLIENT_IP specifies the server IP address that runs pic-search-webclient docker.
Enter the path to the images folder, e.g. /data/images. click Load to load the images. The following screenshot shows the loading process.
Note: After clicking the load button, the system needs to wait for a while to respond. Please do not click again
The loading process may take several minutes. The following screenshot shows the interface with images loaded.
Select an image to search.
Tested with the recommended configuration, the system can complete a reverse image search in a few seconds. To load images from other directories, specify the path in the text box.