Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
image_search
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
service
image_search
Commits
680d0550
Commit
680d0550
authored
Jun 01, 2025
by
zhengyaoqiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
160369c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
test_milvus.py
tests/test_milvus.py
+3
-3
No files found.
tests/test_milvus.py
View file @
680d0550
...
...
@@ -11,8 +11,8 @@ class TestCreateCollectionFunction(unittest.TestCase):
fields
:
List
[
FieldSchema
]
=
[
FieldSchema
(
name
=
"image"
,
dtype
=
DataType
.
VARCHAR
,
max_length
=
256
,
is_primary
=
True
,
auto_id
=
False
),
FieldSchema
(
name
=
"key"
,
dtype
=
DataType
.
VARCHAR
,
max_length
=
256
),
#
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=512) # CLIP ViT-B/32的特征维度为512
FieldSchema
(
name
=
"vector"
,
dtype
=
DataType
.
FLOAT_VECTOR
,
dim
=
768
)
# CLIP ViT-L/14@336px的特征维度为512
FieldSchema
(
name
=
"vector"
,
dtype
=
DataType
.
FLOAT_VECTOR
,
dim
=
512
)
# CLIP ViT-B/32的特征维度为512
#
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=768) # CLIP ViT-L/14@336px的特征维度为512
]
MilvusClient
()
.
connect
()
.
create_collection
(
"pc3"
,
fields
,
"PC3 图片向量存储"
)
...
...
@@ -20,7 +20,7 @@ class TestCreateCollectionFunction(unittest.TestCase):
index_params
=
{
"index_type"
:
"HNSW"
,
"metric_type"
:
"IP"
,
# 内积相似度
"params"
:
{
"M"
:
16
,
"efConstruction"
:
2
00
}
"params"
:
{
"M"
:
32
,
"efConstruction"
:
4
00
}
}
MilvusClient
()
.
connect
()
.
create_index
(
"pc3"
,
"vector"
,
index_params
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment