Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
avvy
Relocalization service
Commits
d5c3c7c8
Commit
d5c3c7c8
authored
2 years ago
by
Alexey
Browse files
Options
Download
Email Patches
Plain Diff
less logging
parent
3a5c5f2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
common/milvus_client.py
+1
-9
common/milvus_client.py
common/processor.py
+1
-3
common/processor.py
server.py
+1
-14
server.py
with
3 additions
and
26 deletions
+3
-26
common/milvus_client.py
View file @
d5c3c7c8
...
...
@@ -359,19 +359,11 @@ class MilvusClient:
log
.
error
(
f
"SEARCH: Something went wrong with coll:
{
collection_name
}
"
)
def
count
(
self
,
collection_name
):
# Get the number of milvus collection
try
:
start
=
time
()
log
.
debug
(
f
"MilvusClient.count:
{
collection_name
}
"
)
coll
=
self
.
prepare_collection
(
collection_name
)
if
not
coll
:
return
0
log
.
debug
(
f
"MilvusClient.count: get rate, time=
{
time
()
-
start
}
"
)
start
=
time
()
num
=
coll
.
rate
log
.
info
(
f
"MilvusClient.count. Result num:
{
num
}
of the collection:
{
collection_name
}
, time=
{
time
()
-
start
}
"
)
return
num
return
coll
.
rate
except
Exception
as
e
:
# log.exception(e)
log
.
exception
(
f
"Failed to count vectors in Milvus
{
collection_name
}
:
{
e
}
"
)
...
...
This diff is collapsed.
Click to expand it.
common/processor.py
View file @
d5c3c7c8
...
...
@@ -100,8 +100,6 @@ class Processor:
return
result
async
def
find
(
self
,
snapshot
):
log
.
debug
(
f
'Processor.find method start'
)
vector
=
await
self
.
resnet_client
.
process_snapshot
(
snapshot
)
if
vector
is
None
:
...
...
@@ -117,7 +115,7 @@ class Processor:
result
=
await
self
.
_find
(
snapshot
,
vector
,
GLOBAL_COLLECTION_NAME
,
128
)
log
.
info
(
f
'Processor.
f
ind result
snapshot
s count
:
{
len
(
result
.
snapshots
)
}
'
)
f
'Processor.
F
ind result
:
{
snapshot
.
braneId
}
{
snapshot
.
latitude
}
{
snapshot
.
longitude
}
:
{
len
(
result
.
snapshots
)
}
'
)
return
result
async
def
add
(
self
,
snapshot
):
...
...
This diff is collapsed.
Click to expand it.
server.py
View file @
d5c3c7c8
...
...
@@ -44,13 +44,6 @@ class GRSServerAsync(grs_service_pb2_grpc.GRSServicer):
self
.
processor
=
Processor
()
async
def
Find
(
self
,
snapshot
,
context
):
nl
=
'
\n
'
log
.
info
(
f
'FIND:
{
snapshot
.
braneId
}
{
snapshot
.
latitude
}
{
snapshot
.
longitude
}
{
snapshot
.
accuracy
}
'
f
'
{
nl
}{
snapshot
.
transform
}
'
f
'
{
nl
}
Planes:
{
len
(
snapshot
.
planes
)
}{
nl
}
Image Size:
{
len
(
snapshot
.
image
)
}
'
)
res
=
validate_args
(
snapshot
,
context
)
if
res
:
log
.
warning
(
f
'GRSServer.Find Invalid parameters'
)
...
...
@@ -59,13 +52,6 @@ class GRSServerAsync(grs_service_pb2_grpc.GRSServicer):
return
result
async
def
Update
(
self
,
snapshot
,
context
):
nl
=
'
\n
'
log
.
info
(
f
'UPD:
{
snapshot
.
braneId
}
{
snapshot
.
latitude
}
{
snapshot
.
longitude
}
{
snapshot
.
accuracy
}
'
f
'
{
nl
}{
snapshot
.
transform
}
'
f
'
{
nl
}
Planes:
{
len
(
snapshot
.
planes
)
}
'
f
'
{
nl
}
Image Size:
{
len
(
snapshot
.
image
)
}
'
)
res
=
validate_args
(
snapshot
,
context
)
if
res
:
log
.
warning
(
f
'GRSServer.Update Invalid parameters'
)
...
...
@@ -91,6 +77,7 @@ async def serve(host, port):
await
server
.
wait_for_termination
()
metrics_serv
.
close
()
DEFAULT_PORT
=
53000
if
__name__
==
'__main__'
:
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help