Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-Private
MPAI-CAE
arp
ARP Library
Commits
af2200e0
Commit
af2200e0
authored
Apr 13, 2023
by
Matteo
Browse files
update
parent
1e50383f
Changes
6
Hide whitespace changes
Inline
Side-by-side
mpai_cae_arp/network/arp.proto
deleted
100644 → 0
View file @
1e50383f
syntax
=
"proto3"
;
/**
* This file is part of the Audio Restoration Package (ARP).
* to compile it run:
*
* protoc -I protos --python_out=protos --grpc_python_out=protos protos/arp.proto
*/
package
arp
;
service
AudioAnalyser
{
rpc
getAimInfo
(
InfoRequest
)
returns
(
Info
)
{}
rpc
analyse
(
ComputationRequest
)
returns
(
stream
ComputationResult
)
{}
}
service
VideoAnalyser
{
rpc
getAimInfo
(
InfoRequest
)
returns
(
Info
)
{}
rpc
analyse
(
ComputationRequest
)
returns
(
stream
ComputationResult
)
{}
}
service
TapeIrregularityClassifier
{
rpc
getAimInfo
(
InfoRequest
)
returns
(
Info
)
{}
rpc
classify
(
ComputationRequest
)
returns
(
stream
ComputationResult
)
{}
}
service
TapeAudioRestoration
{
rpc
getAimInfo
(
InfoRequest
)
returns
(
Info
)
{}
rpc
restore
(
ComputationRequest
)
returns
(
stream
ComputationResult
)
{}
}
service
Packager
{
rpc
getAimInfo
(
InfoRequest
)
returns
(
Info
)
{}
rpc
package
(
ComputationRequest
)
returns
(
stream
ComputationResult
)
{}
}
message
InfoRequest
{
optional
string
field
=
1
;
}
message
Contact
{
string
name
=
1
;
string
email
=
2
;
}
message
License
{
string
name
=
1
;
string
url
=
2
;
}
message
Info
{
string
title
=
1
;
string
description
=
2
;
string
version
=
3
;
Contact
contact
=
4
;
License
license
=
5
;
}
message
ComputationRequest
{
string
working_dir
=
1
;
string
files_name
=
2
;
}
message
ComputationResult
{
bool
success
=
1
;
string
message
=
2
;
}
mpai_cae_arp/network/arp_pb2.py
View file @
af2200e0
...
...
@@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR
=
_descriptor_pool
.
Default
().
AddSerializedFile
(
b
'
\n\t
arp.proto
\x12\x03\x61
rp
\"
+
\n\x0b
InfoRequest
\x12\x12\n\x05\x66
ield
\x18\x01
\x01
(
\t
H
\x00\x88\x01\x01\x42\x08\n\x06
_field
\"
&
\n\
x07\x43
ontac
t
\x12\x
0c
\n\x0
4
name
\x18\x01
\x01
(
\t\x12\
r\n\x05\x65
mail
\x18\x02
\x01
(
\t\"
$
\n\x07
License
\x12\x0c\n\x04
name
\x18\x0
1
\x01
(
\t\x12\x
0b
\n\x0
3
url
\x18\x0
2
\x01
(
\
t\"
y
\n\x04
Info
\x12\r\n\x05
title
\x
1
8\x01
\x01
(
\t
\x
1
2\x
13
\n\x0
b\x64\x65
scription
\x18\x02
\x01
(
\t\x12\x0f\n\x07
version
\x1
8
\x0
3
\x01
(
\t\x12\x1d\n\x07\x63
ontact
\x18\x0
4
\x01
(
\
x0b\x32\x0c
.arp.Contac
t
\x12\x
1d
\n\x07
licens
e
\x18\x0
5
\x01
(
\
x0b\x32\x0c
.arp.License
\"
=
\n\x
12
\x43
o
mputationReques
t
\x12\x
13
\n\x0
b
working_dir
\x18\x01
\x01
(
\t\x12\
x12\n\n
files_name
\x18\x02
\x01
(
\t\"
5
\n\x
11\x43
omputationResult
\x12\x0
f
\n\x0
7
success
\x18\x01
\x01
(
\
x08
\x12\x0
f
\n\x0
7
message
\x18\x02
\x01
(
\t
2|
\n\r
AudioAnalyser
\x12
+
\n\n
getAimInfo
\x12\x10
.arp.InfoRequest
\x1a\t
.arp.Info
\"\x00\x12
>
\n\x07\x61
nalyse
\x12\x17
.arp.ComputationRequest
\x1a\x16
.arp.ComputationResult
\"\x00\x30\x01\x32
|
\n\r
VideoAnalyser
\x12
+
\n\n
getAimInfo
\x12\x10
.arp.InfoRequest
\x1a\t
.arp.Info
\"\x00\x12
>
\n\x07\x61
nalyse
\x12\x17
.arp.ComputationRequest
\x1
a
\x
16
.arp.ComputationResult
\"\x00\x30\x01\x32\x8a\x01\n\x1a
TapeIrregularityClassifier
\x12
+
\n\n
getAimInfo
\x1
2
\x
10
.arp.InfoRequest
\x1a\t
.arp.Info
\"\x00
\x1
2
?
\n\x0
8
\x63
lassify
\x12\x17
.arp.ComputationRequest
\x1a\x16
.arp.ComputationResult
\"\x00\x30
\x0
1
\x32\x
83\x01\n\x14
TapeAudioRestoration
\x12
+
\n\n
getAimInfo
\x12\x10
.arp.InfoRequest
\x1a\t
.arp.Info
\"\x00\x12
>
\n\x07
restore
\x
1
2\x
17
.arp.
ComputationRequest
\x1a\x16
.arp.ComputationResult
\"
\x0
0
\x
30\x01
\x3
2
w
\n\x0
8
Packager
\x12
+
\n\n
getAim
Info
\x12\x10
.arp.InfoRequest
\x1a\
t
.arp.Info
\"\x00\x12
>
\n\x0
7
package
\x12\x
17
.arp.
Computation
Request
\x1a\x1
6
.arp.
ComputationResult
\"\x00\x30\x01\x62\x06
proto3'
)
DESCRIPTOR
=
_descriptor_pool
.
Default
().
AddSerializedFile
(
b
'
\n\t
arp.proto
\x12\x03\x61
rp
\"
+
\n\x0b
InfoRequest
\x12\x12\n\x05\x66
ield
\x18\x01
\x01
(
\t
H
\x00\x88\x01\x01\x42\x08\n\x06
_field
\"
S
\n\
n
JobReques
t
\x12\x
13
\n\x0
b
working_dir
\x18\x01
\x01
(
\t\x12\
x12\n\n
files_
name
\x18\x0
2
\x01
(
\t\x12\x
12
\n\x0
5
index
\x18\x0
3
\x01
(
\
x05
H
\x00
\x
8
8\x01\x01\x
4
2\x
08
\n\x0
6
_index
\"
.
\n\x0b
JobResponse
\x1
2
\x0
e\n\x06
status
\x18\x0
1
\x01
(
\t\x12\x
0f
\n\x07
messag
e
\x18\x0
2
\x01
(
\
t
\"
&
\n\x
07
\x43
o
ntac
t
\x12\x
0c
\n\x0
4
name
\x18\x01
\x01
(
\t\x12\
r\n\x05\x65
mail
\x18\x02
\x01
(
\t\"
$
\n\x
07
License
\x12\x0
c
\n\x0
4
name
\x18\x01
\x01
(
\
t
\x12\x0
b
\n\x0
3
url
\x18\x02
\x01
(
\t
\"\x81\x01\n\x0c
InfoResponse
\x12\r\n\x05
title
\x18\x01
\x01
(
\t\x12\x13\n\x0b\x64\x65
scription
\x1
8
\x
02
\x01
(
\t\x12\x0f\n\x07
version
\x1
8
\x
03
\x01
(
\t\x12
\x1
d
\n\x0
7
\x63
ontact
\x18\x04
\x01
(
\x0
b
\x32\x
0c
.arp.Contact
\x12\x1d\n\x07
license
\x18\x05
\x01
(
\x0b
\x
3
2\x
0c
.arp.
License2f
\n
\x0
3
\x
41
IM
\x12
\x3
0
\n\x0
7
get
Info
\x12\x10
.arp.InfoRequest
\x1a\
x11
.arp.Info
Response
\"\x00\x12
-
\n\x0
4
work
\x12\x
0f
.arp.
Job
Request
\x1a\x1
0
.arp.
JobResponse
\"\x00\x30\x01\x62\x06
proto3'
)
_builder
.
BuildMessageAndEnumDescriptors
(
DESCRIPTOR
,
globals
())
_builder
.
BuildTopDescriptorsAndMessages
(
DESCRIPTOR
,
'arp_pb2'
,
globals
())
...
...
@@ -22,24 +22,16 @@ if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR
.
_options
=
None
_INFOREQUEST
.
_serialized_start
=
18
_INFOREQUEST
.
_serialized_end
=
61
_CONTACT
.
_serialized_start
=
63
_CONTACT
.
_serialized_end
=
101
_LICENSE
.
_serialized_start
=
103
_LICENSE
.
_serialized_end
=
139
_INFO
.
_serialized_start
=
141
_INFO
.
_serialized_end
=
262
_COMPUTATIONREQUEST
.
_serialized_start
=
264
_COMPUTATIONREQUEST
.
_serialized_end
=
325
_COMPUTATIONRESULT
.
_serialized_start
=
327
_COMPUTATIONRESULT
.
_serialized_end
=
380
_AUDIOANALYSER
.
_serialized_start
=
382
_AUDIOANALYSER
.
_serialized_end
=
506
_VIDEOANALYSER
.
_serialized_start
=
508
_VIDEOANALYSER
.
_serialized_end
=
632
_TAPEIRREGULARITYCLASSIFIER
.
_serialized_start
=
635
_TAPEIRREGULARITYCLASSIFIER
.
_serialized_end
=
773
_TAPEAUDIORESTORATION
.
_serialized_start
=
776
_TAPEAUDIORESTORATION
.
_serialized_end
=
907
_PACKAGER
.
_serialized_start
=
909
_PACKAGER
.
_serialized_end
=
1028
_JOBREQUEST
.
_serialized_start
=
63
_JOBREQUEST
.
_serialized_end
=
146
_JOBRESPONSE
.
_serialized_start
=
148
_JOBRESPONSE
.
_serialized_end
=
194
_CONTACT
.
_serialized_start
=
196
_CONTACT
.
_serialized_end
=
234
_LICENSE
.
_serialized_start
=
236
_LICENSE
.
_serialized_end
=
272
_INFORESPONSE
.
_serialized_start
=
275
_INFORESPONSE
.
_serialized_end
=
404
_AIM
.
_serialized_start
=
406
_AIM
.
_serialized_end
=
508
# @@protoc_insertion_point(module_scope)
mpai_cae_arp/network/arp_pb2_grpc.py
View file @
af2200e0
...
...
@@ -5,7 +5,7 @@ import grpc
from
.
import
arp_pb2
as
arp__pb2
class
A
udioAnalyser
Stub
(
object
):
class
A
IM
Stub
(
object
):
"""Missing associated documentation comment in .proto file."""
def
__init__
(
self
,
channel
):
...
...
@@ -14,434 +14,62 @@ class AudioAnalyserStub(object):
Args:
channel: A grpc.Channel.
"""
self
.
get
Aim
Info
=
channel
.
unary_unary
(
'/arp.A
udioAnalyser
/get
Aim
Info'
,
self
.
getInfo
=
channel
.
unary_unary
(
'/arp.A
IM
/getInfo'
,
request_serializer
=
arp__pb2
.
InfoRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
Info
.
FromString
,
response_deserializer
=
arp__pb2
.
Info
Response
.
FromString
,
)
self
.
analyse
=
channel
.
unary_stream
(
'/arp.A
udioAnalyser/analyse
'
,
request_serializer
=
arp__pb2
.
Computation
Request
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
ComputationResult
.
FromString
,
self
.
work
=
channel
.
unary_stream
(
'/arp.A
IM/work
'
,
request_serializer
=
arp__pb2
.
Job
Request
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
JobResponse
.
FromString
,
)
class
A
udioAnalyser
Servicer
(
object
):
class
A
IM
Servicer
(
object
):
"""Missing associated documentation comment in .proto file."""
def
getAimInfo
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
analyse
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
add_AudioAnalyserServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
'getAimInfo'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
getAimInfo
,
request_deserializer
=
arp__pb2
.
InfoRequest
.
FromString
,
response_serializer
=
arp__pb2
.
Info
.
SerializeToString
,
),
'analyse'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
analyse
,
request_deserializer
=
arp__pb2
.
ComputationRequest
.
FromString
,
response_serializer
=
arp__pb2
.
ComputationResult
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'arp.AudioAnalyser'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
# This class is part of an EXPERIMENTAL API.
class
AudioAnalyser
(
object
):
"""Missing associated documentation comment in .proto file."""
@
staticmethod
def
getAimInfo
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.AudioAnalyser/getAimInfo'
,
arp__pb2
.
InfoRequest
.
SerializeToString
,
arp__pb2
.
Info
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
@
staticmethod
def
analyse
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.AudioAnalyser/analyse'
,
arp__pb2
.
ComputationRequest
.
SerializeToString
,
arp__pb2
.
ComputationResult
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
class
VideoAnalyserStub
(
object
):
"""Missing associated documentation comment in .proto file."""
def
__init__
(
self
,
channel
):
"""Constructor.
Args:
channel: A grpc.Channel.
def
getInfo
(
self
,
request
,
context
):
"""
self
.
getAimInfo
=
channel
.
unary_unary
(
'/arp.VideoAnalyser/getAimInfo'
,
request_serializer
=
arp__pb2
.
InfoRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
Info
.
FromString
,
)
self
.
analyse
=
channel
.
unary_stream
(
'/arp.VideoAnalyser/analyse'
,
request_serializer
=
arp__pb2
.
ComputationRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
ComputationResult
.
FromString
,
)
class
VideoAnalyserServicer
(
object
):
"""Missing associated documentation comment in .proto file."""
def
getAimInfo
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
analyse
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
add_VideoAnalyserServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
'getAimInfo'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
getAimInfo
,
request_deserializer
=
arp__pb2
.
InfoRequest
.
FromString
,
response_serializer
=
arp__pb2
.
Info
.
SerializeToString
,
),
'analyse'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
analyse
,
request_deserializer
=
arp__pb2
.
ComputationRequest
.
FromString
,
response_serializer
=
arp__pb2
.
ComputationResult
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'arp.VideoAnalyser'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
# This class is part of an EXPERIMENTAL API.
class
VideoAnalyser
(
object
):
"""Missing associated documentation comment in .proto file."""
@
staticmethod
def
getAimInfo
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.VideoAnalyser/getAimInfo'
,
arp__pb2
.
InfoRequest
.
SerializeToString
,
arp__pb2
.
Info
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
@
staticmethod
def
analyse
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.VideoAnalyser/analyse'
,
arp__pb2
.
ComputationRequest
.
SerializeToString
,
arp__pb2
.
ComputationResult
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
class
TapeIrregularityClassifierStub
(
object
):
"""Missing associated documentation comment in .proto file."""
def
__init__
(
self
,
channel
):
"""Constructor.
Args:
channel: A grpc.Channel.
Get information about the AIM
"""
self
.
getAimInfo
=
channel
.
unary_unary
(
'/arp.TapeIrregularityClassifier/getAimInfo'
,
request_serializer
=
arp__pb2
.
InfoRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
Info
.
FromString
,
)
self
.
classify
=
channel
.
unary_stream
(
'/arp.TapeIrregularityClassifier/classify'
,
request_serializer
=
arp__pb2
.
ComputationRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
ComputationResult
.
FromString
,
)
class
TapeIrregularityClassifierServicer
(
object
):
"""Missing associated documentation comment in .proto file."""
def
getAimInfo
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
classify
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
add_TapeIrregularityClassifierServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
'getAimInfo'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
getAimInfo
,
request_deserializer
=
arp__pb2
.
InfoRequest
.
FromString
,
response_serializer
=
arp__pb2
.
Info
.
SerializeToString
,
),
'classify'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
classify
,
request_deserializer
=
arp__pb2
.
ComputationRequest
.
FromString
,
response_serializer
=
arp__pb2
.
ComputationResult
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'arp.TapeIrregularityClassifier'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
# This class is part of an EXPERIMENTAL API.
class
TapeIrregularityClassifier
(
object
):
"""Missing associated documentation comment in .proto file."""
@
staticmethod
def
getAimInfo
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.TapeIrregularityClassifier/getAimInfo'
,
arp__pb2
.
InfoRequest
.
SerializeToString
,
arp__pb2
.
Info
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
@
staticmethod
def
classify
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.TapeIrregularityClassifier/classify'
,
arp__pb2
.
ComputationRequest
.
SerializeToString
,
arp__pb2
.
ComputationResult
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
class
TapeAudioRestorationStub
(
object
):
"""Missing associated documentation comment in .proto file."""
def
__init__
(
self
,
channel
):
"""Constructor.
Args:
channel: A grpc.Channel.
def
work
(
self
,
request
,
context
):
"""
self
.
getAimInfo
=
channel
.
unary_unary
(
'/arp.TapeAudioRestoration/getAimInfo'
,
request_serializer
=
arp__pb2
.
InfoRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
Info
.
FromString
,
)
self
.
restore
=
channel
.
unary_stream
(
'/arp.TapeAudioRestoration/restore'
,
request_serializer
=
arp__pb2
.
ComputationRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
ComputationResult
.
FromString
,
)
class
TapeAudioRestorationServicer
(
object
):
"""Missing associated documentation comment in .proto file."""
def
getAimInfo
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
restore
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
add_TapeAudioRestorationServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
'getAimInfo'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
getAimInfo
,
request_deserializer
=
arp__pb2
.
InfoRequest
.
FromString
,
response_serializer
=
arp__pb2
.
Info
.
SerializeToString
,
),
'restore'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
restore
,
request_deserializer
=
arp__pb2
.
ComputationRequest
.
FromString
,
response_serializer
=
arp__pb2
.
ComputationResult
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'arp.TapeAudioRestoration'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
# This class is part of an EXPERIMENTAL API.
class
TapeAudioRestoration
(
object
):
"""Missing associated documentation comment in .proto file."""
@
staticmethod
def
getAimInfo
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.TapeAudioRestoration/getAimInfo'
,
arp__pb2
.
InfoRequest
.
SerializeToString
,
arp__pb2
.
Info
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
@
staticmethod
def
restore
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
call_credentials
=
None
,
insecure
=
False
,
compression
=
None
,
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.TapeAudioRestoration/restore'
,
arp__pb2
.
ComputationRequest
.
SerializeToString
,
arp__pb2
.
ComputationResult
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
class
PackagerStub
(
object
):
"""Missing associated documentation comment in .proto file."""
def
__init__
(
self
,
channel
):
"""Constructor.
Args:
channel: A grpc.Channel.
A generic method to perform the AIM task
"""
self
.
getAimInfo
=
channel
.
unary_unary
(
'/arp.Packager/getAimInfo'
,
request_serializer
=
arp__pb2
.
InfoRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
Info
.
FromString
,
)
self
.
package
=
channel
.
unary_stream
(
'/arp.Packager/package'
,
request_serializer
=
arp__pb2
.
ComputationRequest
.
SerializeToString
,
response_deserializer
=
arp__pb2
.
ComputationResult
.
FromString
,
)
class
PackagerServicer
(
object
):
"""Missing associated documentation comment in .proto file."""
def
getAimInfo
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
package
(
self
,
request
,
context
):
"""Missing associated documentation comment in .proto file."""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'Method not implemented!'
)
raise
NotImplementedError
(
'Method not implemented!'
)
def
add_
Packager
Servicer_to_server
(
servicer
,
server
):
def
add_
AIM
Servicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
'get
Aim
Info'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
get
Aim
Info
,
'getInfo'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
getInfo
,
request_deserializer
=
arp__pb2
.
InfoRequest
.
FromString
,
response_serializer
=
arp__pb2
.
Info
.
SerializeToString
,
response_serializer
=
arp__pb2
.
Info
Response
.
SerializeToString
,
),
'
package
'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
package
,
request_deserializer
=
arp__pb2
.
Computation
Request
.
FromString
,
response_serializer
=
arp__pb2
.
ComputationResult
.
SerializeToString
,
'
work
'
:
grpc
.
unary_stream_rpc_method_handler
(
servicer
.
work
,
request_deserializer
=
arp__pb2
.
Job
Request
.
FromString
,
response_serializer
=
arp__pb2
.
JobResponse
.
SerializeToString
,
),
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'arp.
Packager
'
,
rpc_method_handlers
)
'arp.
AIM
'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
# This class is part of an EXPERIMENTAL API.
class
Packager
(
object
):
class
AIM
(
object
):
"""Missing associated documentation comment in .proto file."""
@
staticmethod
def
get
Aim
Info
(
request
,
def
getInfo
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
...
...
@@ -451,14 +79,14 @@ class Packager(object):
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.
Packager
/get
Aim
Info'
,
return
grpc
.
experimental
.
unary_unary
(
request
,
target
,
'/arp.
AIM
/getInfo'
,
arp__pb2
.
InfoRequest
.
SerializeToString
,
arp__pb2
.
Info
.
FromString
,
arp__pb2
.
Info
Response
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
@
staticmethod
def
package
(
request
,
def
work
(
request
,
target
,
options
=
(),
channel_credentials
=
None
,
...
...
@@ -468,8 +96,8 @@ class Packager(object):
wait_for_ready
=
None
,
timeout
=
None
,
metadata
=
None
):
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.
Packager/package
'
,
arp__pb2
.
Computation
Request
.
SerializeToString
,
arp__pb2
.
ComputationResult
.
FromString
,
return
grpc
.
experimental
.
unary_stream
(
request
,
target
,
'/arp.
AIM/work
'
,
arp__pb2
.
Job
Request
.
SerializeToString
,
arp__pb2
.
JobResponse
.
FromString
,
options
,
channel_credentials
,
insecure
,
call_credentials
,
compression
,
wait_for_ready
,
timeout
,
metadata
)
mpai_cae_arp/types/irregularity.py
View file @
af2200e0
...
...
@@ -52,6 +52,15 @@ class IrregularityProperties(BaseModel):
"WritingEqualisationStandard"
:
self
.
writing_equalisation
.
value
,
}
def
get_irregularity_type
(
self
)
->
IrregularityType
:
if
self
.
reading_equalisation
!=
self
.
writing_equalisation
:
if
self
.
reading_speed
!=
self
.
writing_speed
:
return
IrregularityType
.
SPEED_AND_EQUALIZATION
return
IrregularityType
.
EQUALIZATION
if
self
.
reading_speed
!=
self
.
writing_speed
:
return
IrregularityType
.
SPEED
return
None
class
Irregularity
(
BaseModel
):
irregularity_ID
:
uuid
.
UUID
...
...
protos/arp.proto
0 → 100644
View file @
af2200e0
syntax
=
"proto3"
;
/**
* This file is part of the Audio Restoration Package (ARP).
* to compile it run:
*
* protoc -I protos --python_out=mpai_cae_arp/network --grpc_python_out=mpai_cae_arp/network protos/arp.proto
*/
package
arp
;
service
AIM
{
/*
* Get information about the AIM
*/
rpc
getInfo
(
InfoRequest
)
returns
(
InfoResponse
)
{}
/*
* A generic method to perform the AIM task
*/
rpc
work
(
JobRequest
)
returns
(
stream
JobResponse
)
{}
}
/*
* Require to get information about the AIM
* field: the field to get information about (None to get all fields)
*/
message
InfoRequest
{
optional
string
field
=
1
;
}
/*
* The request of the AIM
* working_dir: the working directory of the AIM
* files_name: the name of the files to process
* index: the index of the file to process (It is used only for
* Audio and Video Analysis to specify the Irregularity File Index)
*/
message
JobRequest
{
string
working_dir
=
1
;
string
files_name
=
2
;
optional
int32
index
=
3
;
}
/*
* The response of the AIM
* status: the status of the AIM
* message: the message of the AIM
*/
message
JobResponse
{
string
status
=
1
;
string
message
=
2
;
}
/*
* The information about the AIM author
*/
message
Contact
{
string
name
=
1
;
string
email
=
2
;
}
/*
* The license of the AIM
*/
message
License
{
string
name
=
1
;
string
url
=
2
;
}
/*
* The information about the AIM
* title: the title of the AIM
* description: a brief description of the AIM
* version: the version of the AIM
* contact: how to contact the AIM author
* license: the license of the AIM
*/
message
InfoResponse
{
string
title
=
1
;
string
description
=
2
;
string
version
=
3
;
Contact
contact
=
4
;
License
license
=
5
;
}
pyproject.toml
View file @
af2200e0
[tool.poetry]
name
=
"mpai-cae-arp"
version
=
"0.3.
0
"
version
=
"0.3.
2
"
description
=
"The MPAI CAE-ARP software API"
authors
=
[
"Matteo Spanio <dev2@audioinnova.com>"
]
readme
=
"README.md"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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