关于保存特征的一些代码
This commit is contained in:
23
test/outfit_matcher_milvus/2.create collection.py
Normal file
23
test/outfit_matcher_milvus/2.create collection.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from pymilvus import MilvusClient, DataType
|
||||
|
||||
# 创建client ,配置databases
|
||||
client = MilvusClient(
|
||||
uri="http://10.1.1.240:19530",
|
||||
token="root:Milvus",
|
||||
db_name="mixi"
|
||||
)
|
||||
from pymilvus import MilvusClient, DataType
|
||||
|
||||
schema = MilvusClient.create_schema(
|
||||
auto_id=True,
|
||||
enable_dynamic_field=False,
|
||||
)
|
||||
|
||||
schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
|
||||
schema.add_field(field_name="image_path", datatype=DataType.VARCHAR, max_length=200)
|
||||
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=64)
|
||||
|
||||
client.create_collection(
|
||||
collection_name="mixi_outfit",
|
||||
schema=schema
|
||||
)
|
||||
Reference in New Issue
Block a user