"""搭建主特征库"""
from test_logic import create_milvus, img2feature
from config import config as conf
from img_data import library_imgs, temp_imgs

def createMainMilvus(imgs_dict):     ##imgs->{barcode1:[img1_1...img1_n], barcode2:[img2_1...img2_n]}
    barcode_list, imgs_list = img2feature(imgs_dict)
    mainMilvus = create_milvus('main_features', conf.host, conf.port, barcode_list, imgs_list)
    return mainMilvus
def createTempMilvus(imgs_dict):     ##imgs->{barcode1:[img1_1...img1_n], barcode2:[img2_1...img2_n]}
    barcode_list, imgs_list = img2feature(imgs_dict)
    tempMilvus = create_milvus('temp_features', conf.host, conf.port, barcode_list, imgs_list)
    return tempMilvus

if __name__ == "__main__":
    createMainMilvus(library_imgs)
    # createTempMilvus(temp_imgs)