milvus-io / bootcamp

Dealing with all unstructured data, such as reverse image search, audio search, molecular search, video analysis, question and answer systems, NLP, etc.
https://milvus.io
Apache License 2.0
1.81k stars 555 forks source link

face_recognition_system quick_deploy search_face_milvusv2.py #1115

Closed yxzai closed 1 year ago

yxzai commented 1 year ago

In the search_image method,milvus has already searched the following results: ["['(distance: 0.0005720879416912794, id: 1)', '(distance: 0.23134899139404297, id: 26)', '(distance: 0.272431343793869, id: 24)']"] However, the picture is not shown in the end. I found that there seems to be a problem with the content of temp during the debug process. The temp is created as an empty list. I did not understand the content of id_to_identity during debugging. Its shape is a list with a length of 20, and each element of the list is a tuple containing a list and a value. I would like to know what the content of this data is.

yxzai commented 1 year ago

temp = [] plt.imshow(insert_image) for x in range(len(results)): for i, v in id_to_identity: if results[x][0].id == i: temp.append(v) print(temp)

Why is results[x][0].id equal to i? If i is the id list here and v is the corresponding identity, it should be to judge whether id is in i.

Spnetic-5 commented 1 year ago

In the search_image method,milvus has already searched the following results: ["['(distance: 0.0005720879416912794, id: 1)', '(distance: 0.23134899139404297, id: 26)', '(distance: 0.272431343793869, id: 24)']"] However, the picture is not shown in the end. I found that there seems to be a problem with the content of the temp during the debug process. The temp is created as an empty list. I did not understand the content of id_to_identity during debugging. Its shape is a list with a length of 20, and each element of the list is a tuple containing a list and a value. I would like to know what the content of this data is.

Script for plotting output pictures can vary in search_face_milvusv2.py reason being there can be different paths/ids to the dataset folders, depending upon your folder structure. Although it can be shown perfectly using search_face_milvusv1.py. You can try running the latter or can edit this script according to your celeb_reorganized folder structure.

id_to_identity file contains the mapping of unique identities to their respective ids in the Milvus collection. It is used for searching embeddings by id in the database.

Spnetic-5 commented 1 year ago

temp = [] plt.imshow(insert_image) for x in range(len(results)): for i, v in id_to_identity: if results[x][0].id == i: temp.append(v) print(temp)

Why is results[x][0].id equal to i? If i is the id list here and v is the corresponding identity, it should be to judge whether id is in i.

In the results, we get distance and id, we search for this id in the database, and if they match we append ids for embeddings into the temp and then we fetch & display images from that specific folder from the local dataset.

nagem07 commented 1 year ago

Hi

I am having a similar issue where the temp variable remains empty. Bug exists on first example. The second version which uses Milvus 1.1.0 works like a charm. Appreciate if you could identify the error.

Spnetic-5 commented 1 year ago

Hey, @nagem07 Thank you for exploring Face Recognition Bootcamp; in order to retrieve search results, please see if local data and database are having same schema structure and ensure that image to id mapping is correct, and then try running the notebook once again.