Commit af2200e0 authored by Matteo's avatar Matteo
Browse files

update

parent 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;
}
...@@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default() ...@@ -13,7 +13,7 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tarp.proto\x12\x03\x61rp\"+\n\x0bInfoRequest\x12\x12\n\x05\x66ield\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_field\"&\n\x07\x43ontact\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x65mail\x18\x02 \x01(\t\"$\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"y\n\x04Info\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x1d\n\x07\x63ontact\x18\x04 \x01(\x0b\x32\x0c.arp.Contact\x12\x1d\n\x07license\x18\x05 \x01(\x0b\x32\x0c.arp.License\"=\n\x12\x43omputationRequest\x12\x13\n\x0bworking_dir\x18\x01 \x01(\t\x12\x12\n\nfiles_name\x18\x02 \x01(\t\"5\n\x11\x43omputationResult\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t2|\n\rAudioAnalyser\x12+\n\ngetAimInfo\x12\x10.arp.InfoRequest\x1a\t.arp.Info\"\x00\x12>\n\x07\x61nalyse\x12\x17.arp.ComputationRequest\x1a\x16.arp.ComputationResult\"\x00\x30\x01\x32|\n\rVideoAnalyser\x12+\n\ngetAimInfo\x12\x10.arp.InfoRequest\x1a\t.arp.Info\"\x00\x12>\n\x07\x61nalyse\x12\x17.arp.ComputationRequest\x1a\x16.arp.ComputationResult\"\x00\x30\x01\x32\x8a\x01\n\x1aTapeIrregularityClassifier\x12+\n\ngetAimInfo\x12\x10.arp.InfoRequest\x1a\t.arp.Info\"\x00\x12?\n\x08\x63lassify\x12\x17.arp.ComputationRequest\x1a\x16.arp.ComputationResult\"\x00\x30\x01\x32\x83\x01\n\x14TapeAudioRestoration\x12+\n\ngetAimInfo\x12\x10.arp.InfoRequest\x1a\t.arp.Info\"\x00\x12>\n\x07restore\x12\x17.arp.ComputationRequest\x1a\x16.arp.ComputationResult\"\x00\x30\x01\x32w\n\x08Packager\x12+\n\ngetAimInfo\x12\x10.arp.InfoRequest\x1a\t.arp.Info\"\x00\x12>\n\x07package\x12\x17.arp.ComputationRequest\x1a\x16.arp.ComputationResult\"\x00\x30\x01\x62\x06proto3') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tarp.proto\x12\x03\x61rp\"+\n\x0bInfoRequest\x12\x12\n\x05\x66ield\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_field\"S\n\nJobRequest\x12\x13\n\x0bworking_dir\x18\x01 \x01(\t\x12\x12\n\nfiles_name\x18\x02 \x01(\t\x12\x12\n\x05index\x18\x03 \x01(\x05H\x00\x88\x01\x01\x42\x08\n\x06_index\".\n\x0bJobResponse\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\"&\n\x07\x43ontact\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05\x65mail\x18\x02 \x01(\t\"$\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"\x81\x01\n\x0cInfoResponse\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x1d\n\x07\x63ontact\x18\x04 \x01(\x0b\x32\x0c.arp.Contact\x12\x1d\n\x07license\x18\x05 \x01(\x0b\x32\x0c.arp.License2f\n\x03\x41IM\x12\x30\n\x07getInfo\x12\x10.arp.InfoRequest\x1a\x11.arp.InfoResponse\"\x00\x12-\n\x04work\x12\x0f.arp.JobRequest\x1a\x10.arp.JobResponse\"\x00\x30\x01\x62\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'arp_pb2', globals()) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'arp_pb2', globals())
...@@ -22,24 +22,16 @@ if _descriptor._USE_C_DESCRIPTORS == False: ...@@ -22,24 +22,16 @@ if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None DESCRIPTOR._options = None
_INFOREQUEST._serialized_start=18 _INFOREQUEST._serialized_start=18
_INFOREQUEST._serialized_end=61 _INFOREQUEST._serialized_end=61
_CONTACT._serialized_start=63 _JOBREQUEST._serialized_start=63
_CONTACT._serialized_end=101 _JOBREQUEST._serialized_end=146
_LICENSE._serialized_start=103 _JOBRESPONSE._serialized_start=148
_LICENSE._serialized_end=139 _JOBRESPONSE._serialized_end=194
_INFO._serialized_start=141 _CONTACT._serialized_start=196
_INFO._serialized_end=262 _CONTACT._serialized_end=234
_COMPUTATIONREQUEST._serialized_start=264 _LICENSE._serialized_start=236
_COMPUTATIONREQUEST._serialized_end=325 _LICENSE._serialized_end=272
_COMPUTATIONRESULT._serialized_start=327 _INFORESPONSE._serialized_start=275
_COMPUTATIONRESULT._serialized_end=380 _INFORESPONSE._serialized_end=404
_AUDIOANALYSER._serialized_start=382 _AIM._serialized_start=406
_AUDIOANALYSER._serialized_end=506 _AIM._serialized_end=508
_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
# @@protoc_insertion_point(module_scope) # @@protoc_insertion_point(module_scope)
...@@ -5,7 +5,7 @@ import grpc ...@@ -5,7 +5,7 @@ import grpc
from . import arp_pb2 as arp__pb2 from . import arp_pb2 as arp__pb2
class AudioAnalyserStub(object): class AIMStub(object):
"""Missing associated documentation comment in .proto file.""" """Missing associated documentation comment in .proto file."""
def __init__(self, channel): def __init__(self, channel):
...@@ -14,434 +14,62 @@ class AudioAnalyserStub(object): ...@@ -14,434 +14,62 @@ class AudioAnalyserStub(object):
Args: Args:
channel: A grpc.Channel. channel: A grpc.Channel.
""" """
self.getAimInfo = channel.unary_unary( self.getInfo = channel.unary_unary(
'/arp.AudioAnalyser/getAimInfo', '/arp.AIM/getInfo',
request_serializer=arp__pb2.InfoRequest.SerializeToString, request_serializer=arp__pb2.InfoRequest.SerializeToString,
response_deserializer=arp__pb2.Info.FromString, response_deserializer=arp__pb2.InfoResponse.FromString,
) )
self.analyse = channel.unary_stream( self.work = channel.unary_stream(
'/arp.AudioAnalyser/analyse', '/arp.AIM/work',
request_serializer=arp__pb2.ComputationRequest.SerializeToString, request_serializer=arp__pb2.JobRequest.SerializeToString,
response_deserializer=arp__pb2.ComputationResult.FromString, response_deserializer=arp__pb2.JobResponse.FromString,
) )
class AudioAnalyserServicer(object): class AIMServicer(object):
"""Missing associated documentation comment in .proto file.""" """Missing associated documentation comment in .proto file."""
def getAimInfo(self, request, context): def getInfo(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.
""" """
self.getAimInfo = channel.unary_unary( Get information about the AIM
'/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.
""" """
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_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!') context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') raise NotImplementedError('Method not implemented!')
def classify(self, request, context): def work(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.
""" """
self.getAimInfo = channel.unary_unary( A generic method to perform the AIM task
'/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.
""" """
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_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!') context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') raise NotImplementedError('Method not implemented!')
def add_PackagerServicer_to_server(servicer, server): def add_AIMServicer_to_server(servicer, server):
rpc_method_handlers = { rpc_method_handlers = {
'getAimInfo': grpc.unary_unary_rpc_method_handler( 'getInfo': grpc.unary_unary_rpc_method_handler(
servicer.getAimInfo, servicer.getInfo,
request_deserializer=arp__pb2.InfoRequest.FromString, request_deserializer=arp__pb2.InfoRequest.FromString,
response_serializer=arp__pb2.Info.SerializeToString, response_serializer=arp__pb2.InfoResponse.SerializeToString,
), ),
'package': grpc.unary_stream_rpc_method_handler( 'work': grpc.unary_stream_rpc_method_handler(
servicer.package, servicer.work,
request_deserializer=arp__pb2.ComputationRequest.FromString, request_deserializer=arp__pb2.JobRequest.FromString,
response_serializer=arp__pb2.ComputationResult.SerializeToString, response_serializer=arp__pb2.JobResponse.SerializeToString,
), ),
} }
generic_handler = grpc.method_handlers_generic_handler( generic_handler = grpc.method_handlers_generic_handler(
'arp.Packager', rpc_method_handlers) 'arp.AIM', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,)) server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API. # This class is part of an EXPERIMENTAL API.
class Packager(object): class AIM(object):
"""Missing associated documentation comment in .proto file.""" """Missing associated documentation comment in .proto file."""
@staticmethod @staticmethod
def getAimInfo(request, def getInfo(request,
target, target,
options=(), options=(),
channel_credentials=None, channel_credentials=None,
...@@ -451,14 +79,14 @@ class Packager(object): ...@@ -451,14 +79,14 @@ class Packager(object):
wait_for_ready=None, wait_for_ready=None,
timeout=None, timeout=None,
metadata=None): metadata=None):
return grpc.experimental.unary_unary(request, target, '/arp.Packager/getAimInfo', return grpc.experimental.unary_unary(request, target, '/arp.AIM/getInfo',
arp__pb2.InfoRequest.SerializeToString, arp__pb2.InfoRequest.SerializeToString,
arp__pb2.Info.FromString, arp__pb2.InfoResponse.FromString,
options, channel_credentials, options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod @staticmethod
def package(request, def work(request,
target, target,
options=(), options=(),
channel_credentials=None, channel_credentials=None,
...@@ -468,8 +96,8 @@ class Packager(object): ...@@ -468,8 +96,8 @@ class Packager(object):
wait_for_ready=None, wait_for_ready=None,
timeout=None, timeout=None,
metadata=None): metadata=None):
return grpc.experimental.unary_stream(request, target, '/arp.Packager/package', return grpc.experimental.unary_stream(request, target, '/arp.AIM/work',
arp__pb2.ComputationRequest.SerializeToString, arp__pb2.JobRequest.SerializeToString,
arp__pb2.ComputationResult.FromString, arp__pb2.JobResponse.FromString,
options, channel_credentials, options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
...@@ -52,6 +52,15 @@ class IrregularityProperties(BaseModel): ...@@ -52,6 +52,15 @@ class IrregularityProperties(BaseModel):
"WritingEqualisationStandard": self.writing_equalisation.value, "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): class Irregularity(BaseModel):
irregularity_ID: uuid.UUID irregularity_ID: uuid.UUID
......
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;
}
[tool.poetry] [tool.poetry]
name = "mpai-cae-arp" name = "mpai-cae-arp"
version = "0.3.0" version = "0.3.2"
description = "The MPAI CAE-ARP software API" description = "The MPAI CAE-ARP software API"
authors = ["Matteo Spanio <dev2@audioinnova.com>"] authors = ["Matteo Spanio <dev2@audioinnova.com>"]
readme = "README.md" readme = "README.md"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment