Skip to content

Commit ba44340

Browse files
committed
update according to last solar framework commit
1 parent 0bffebc commit ba44340

36 files changed

+3845
-131
lines changed

IAsyncRelocalizationPipeline_grpcProxy.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ void IAsyncRelocalizationPipeline_grpcProxy::unloadComponent ()
3333

3434
XPCFErrorCode IAsyncRelocalizationPipeline_grpcProxy::onConfigured()
3535
{
36-
m_channel = ::grpc::CreateChannel(m_channelUrl, xpcf::GrpcHelper::getCredentials(static_cast<xpcf::grpcCredentials>(m_channelCredentials)));
36+
::grpc::ChannelArguments ch_args;
37+
ch_args.SetMaxReceiveMessageSize(-1);
38+
ch_args.SetMaxSendMessageSize(-1);
39+
m_channel = ::grpc::CreateCustomChannel(m_channelUrl,
40+
xpcf::GrpcHelper::getCredentials(static_cast<xpcf::grpcCredentials>(m_channelCredentials)),
41+
ch_args);
3742
m_grpcStub = ::grpcIAsyncRelocalizationPipeline::grpcIAsyncRelocalizationPipelineService::NewStub(m_channel);
3843
for (auto & compressionLine : m_grpcProxyCompressionConfig) {
3944
translateClientConfiguration(compressionLine, m_serviceCompressionInfos, m_methodCompressionInfosMap);

IAsyncRelocalizationPipeline_grpcProxy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
6767
};
6868

6969

70-
#endif
70+
#endif

IAsyncRelocalizationPipeline_grpcServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
7070
static constexpr const char * DESCRIPTION = "IAsyncRelocalizationPipeline_grpcServer grpc server component";
7171
};
7272

73-
#endif
73+
#endif

IDenseMappingPipeline_grpcProxy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
5252
};
5353

5454

55-
#endif
55+
#endif

IDenseMappingPipeline_grpcServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
5555
static constexpr const char * DESCRIPTION = "IDenseMappingPipeline_grpcServer grpc server component";
5656
};
5757

58-
#endif
58+
#endif

IMapManager_grpcProxy.cpp

+30-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IMapManager_grpcProxy::IMapManager_grpcProxy():xpcf::ConfigurableBase(xpcf::toMa
1919
declareInterface<SolAR::api::storage::IMapManager>(this);
2020
declareProperty("channelUrl",m_channelUrl);
2121
declareProperty("channelCredentials",m_channelCredentials);
22-
m_grpcProxyCompressionConfig.resize(19);
22+
m_grpcProxyCompressionConfig.resize(20);
2323
declarePropertySequence("grpc_compress_proxy", m_grpcProxyCompressionConfig);
2424
}
2525

@@ -505,6 +505,35 @@ int IMapManager_grpcProxy::keyframePruning(std::vector<SRef<SolAR::datastructur
505505
}
506506

507507

508+
SolAR::FrameworkReturnCode IMapManager_grpcProxy::visibilityPruning()
509+
{
510+
::grpc::ClientContext context;
511+
::grpcIMapManager::visibilityPruningRequest reqIn;
512+
::grpcIMapManager::visibilityPruningResponse respOut;
513+
#ifndef DISABLE_GRPC_COMPRESSION
514+
xpcf::grpcCompressionInfos proxyCompressionInfo = xpcf::deduceClientCompressionInfo(m_serviceCompressionInfos, "visibilityPruning", m_methodCompressionInfosMap);
515+
xpcf::grpcCompressType serverCompressionType = xpcf::prepareClientCompressionContext(context, proxyCompressionInfo);
516+
reqIn.set_grpcservercompressionformat (static_cast<int32_t>(serverCompressionType));
517+
#endif
518+
#ifdef ENABLE_PROXY_TIMERS
519+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
520+
std::cout << "====> IMapManager_grpcProxy::visibilityPruning request sent at " << to_simple_string(start) << std::endl;
521+
#endif
522+
::grpc::Status grpcRemoteStatus = m_grpcStub->visibilityPruning(&context, reqIn, &respOut);
523+
#ifdef ENABLE_PROXY_TIMERS
524+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
525+
std::cout << "====> IMapManager_grpcProxy::visibilityPruning response received at " << to_simple_string(end) << std::endl;
526+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
527+
#endif
528+
if (!grpcRemoteStatus.ok()) {
529+
std::cout << "visibilityPruning rpc failed." << std::endl;
530+
throw xpcf::RemotingException("grpcIMapManagerService","visibilityPruning",static_cast<uint32_t>(grpcRemoteStatus.error_code()));
531+
}
532+
533+
return static_cast<SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue());
534+
}
535+
536+
508537
SolAR::FrameworkReturnCode IMapManager_grpcProxy::saveToFile() const
509538
{
510539
::grpc::ClientContext context;

IMapManager_grpcProxy.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class IMapManager_grpcProxy: public org::bcom::xpcf::ConfigurableBase, virtual
3737
SolAR::FrameworkReturnCode getCameraParameters(uint32_t const id, SolAR::datastructure::CameraParameters& cameraParameters) override;
3838
int pointCloudPruning(std::vector<SRef<SolAR::datastructure::CloudPoint>> const& cloudPoints) override;
3939
int keyframePruning(std::vector<SRef<SolAR::datastructure::Keyframe>> const& keyframes) override;
40+
SolAR::FrameworkReturnCode visibilityPruning() override;
4041
SolAR::FrameworkReturnCode saveToFile() const override;
4142
SolAR::FrameworkReturnCode loadFromFile() override;
4243
SolAR::FrameworkReturnCode deleteFile() override;

IMapManager_grpcServer.cpp

+23-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IMapManager_grpcServer::IMapManager_grpcServer():xpcf::ConfigurableBase(xpcf::to
1414
{
1515
declareInterface<xpcf::IGrpcService>(this);
1616
declareInjectable<SolAR::api::storage::IMapManager>(m_grpcService.m_xpcfComponent);
17-
m_grpcServerCompressionConfig.resize(19);
17+
m_grpcServerCompressionConfig.resize(20);
1818
declarePropertySequence("grpc_compress_server", m_grpcServerCompressionConfig);
1919
}
2020

@@ -398,6 +398,28 @@ ::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::keyframePruni
398398
}
399399

400400

401+
::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::visibilityPruning(::grpc::ServerContext* context, const ::grpcIMapManager::visibilityPruningRequest* request, ::grpcIMapManager::visibilityPruningResponse* response)
402+
{
403+
#ifndef DISABLE_GRPC_COMPRESSION
404+
xpcf::grpcCompressType askedCompressionType = static_cast<xpcf::grpcCompressType>(request->grpcservercompressionformat());
405+
xpcf::grpcServerCompressionInfos serverCompressInfo = xpcf::deduceServerCompressionType(askedCompressionType, m_serviceCompressionInfos, "visibilityPruning", m_methodCompressionInfosMap);
406+
xpcf::prepareServerCompressionContext(context, serverCompressInfo);
407+
#endif
408+
#ifdef ENABLE_SERVER_TIMERS
409+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
410+
std::cout << "====> IMapManager_grpcServer::visibilityPruning request received at " << to_simple_string(start) << std::endl;
411+
#endif
412+
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->visibilityPruning();
413+
response->set_xpcfgrpcreturnvalue(static_cast<int32_t>(returnValue));
414+
#ifdef ENABLE_SERVER_TIMERS
415+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
416+
std::cout << "====> IMapManager_grpcServer::visibilityPruning response sent at " << to_simple_string(end) << std::endl;
417+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
418+
#endif
419+
return ::grpc::Status::OK;
420+
}
421+
422+
401423
::grpc::Status IMapManager_grpcServer::grpcIMapManagerServiceImpl::saveToFile(::grpc::ServerContext* context, const ::grpcIMapManager::saveToFileRequest* request, ::grpcIMapManager::saveToFileResponse* response)
402424
{
403425
#ifndef DISABLE_GRPC_COMPRESSION

IMapManager_grpcServer.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class IMapManager_grpcServer: public org::bcom::xpcf::ConfigurableBase, virtual
4040
::grpc::Status getCameraParameters_grpc1(::grpc::ServerContext* context, const ::grpcIMapManager::getCameraParameters_grpc1Request* request, ::grpcIMapManager::getCameraParameters_grpc1Response* response) override;
4141
::grpc::Status pointCloudPruning(::grpc::ServerContext* context, const ::grpcIMapManager::pointCloudPruningRequest* request, ::grpcIMapManager::pointCloudPruningResponse* response) override;
4242
::grpc::Status keyframePruning(::grpc::ServerContext* context, const ::grpcIMapManager::keyframePruningRequest* request, ::grpcIMapManager::keyframePruningResponse* response) override;
43+
::grpc::Status visibilityPruning(::grpc::ServerContext* context, const ::grpcIMapManager::visibilityPruningRequest* request, ::grpcIMapManager::visibilityPruningResponse* response) override;
4344
::grpc::Status saveToFile(::grpc::ServerContext* context, const ::grpcIMapManager::saveToFileRequest* request, ::grpcIMapManager::saveToFileResponse* response) override;
4445
::grpc::Status loadFromFile(::grpc::ServerContext* context, const ::grpcIMapManager::loadFromFileRequest* request, ::grpcIMapManager::loadFromFileResponse* response) override;
4546
::grpc::Status deleteFile(::grpc::ServerContext* context, const ::grpcIMapManager::deleteFileRequest* request, ::grpcIMapManager::deleteFileResponse* response) override;

IMapUpdatePipeline_grpcProxy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
5555
};
5656

5757

58-
#endif
58+
#endif

IMapUpdatePipeline_grpcServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
5858
static constexpr const char * DESCRIPTION = "IMapUpdatePipeline_grpcServer grpc server component";
5959
};
6060

61-
#endif
61+
#endif

IMappingPipeline_grpcProxy.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxy
5858
};
5959

6060

61-
#endif
61+
#endif

IMappingPipeline_grpcServer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::serve
6161
static constexpr const char * DESCRIPTION = "IMappingPipeline_grpcServer grpc server component";
6262
};
6363

64-
#endif
64+
#endif

IPanopticSegmentation_grpcProxy.cpp

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// GRPC Proxy Class implementation generated with xpcf_grpc_gen
2+
#include "IPanopticSegmentation_grpcProxy.h"
3+
#include <cstddef>
4+
#include <boost/date_time.hpp>
5+
#include <xpcf/core/Exception.h>
6+
#include <xpcf/remoting/ISerializable.h>
7+
#include <grpcpp/client_context.h>
8+
#include <grpcpp/create_channel.h>
9+
#include <grpcpp/security/credentials.h>
10+
#include <boost/algorithm/string.hpp>
11+
namespace xpcf = org::bcom::xpcf;
12+
13+
template<> org::bcom::xpcf::grpc::proxyIPanopticSegmentation::IPanopticSegmentation_grpcProxy* xpcf::ComponentFactory::createInstance<org::bcom::xpcf::grpc::proxyIPanopticSegmentation::IPanopticSegmentation_grpcProxy>();
14+
15+
namespace org::bcom::xpcf::grpc::proxyIPanopticSegmentation {
16+
17+
IPanopticSegmentation_grpcProxy::IPanopticSegmentation_grpcProxy():xpcf::ConfigurableBase(xpcf::toMap<IPanopticSegmentation_grpcProxy>())
18+
{
19+
declareInterface<SolAR::api::segm::IPanopticSegmentation>(this);
20+
declareProperty("channelUrl",m_channelUrl);
21+
declareProperty("channelCredentials",m_channelCredentials);
22+
m_grpcProxyCompressionConfig.resize(2);
23+
declarePropertySequence("grpc_compress_proxy", m_grpcProxyCompressionConfig);
24+
}
25+
26+
27+
void IPanopticSegmentation_grpcProxy::unloadComponent ()
28+
{
29+
delete this;
30+
return;
31+
}
32+
33+
34+
XPCFErrorCode IPanopticSegmentation_grpcProxy::onConfigured()
35+
{
36+
m_channel = ::grpc::CreateChannel(m_channelUrl, xpcf::GrpcHelper::getCredentials(static_cast<xpcf::grpcCredentials>(m_channelCredentials)));
37+
m_grpcStub = ::grpcIPanopticSegmentation::grpcIPanopticSegmentationService::NewStub(m_channel);
38+
for (auto & compressionLine : m_grpcProxyCompressionConfig) {
39+
translateClientConfiguration(compressionLine, m_serviceCompressionInfos, m_methodCompressionInfosMap);
40+
}
41+
return xpcf::XPCFErrorCode::_SUCCESS;
42+
}
43+
44+
45+
SolAR::FrameworkReturnCode IPanopticSegmentation_grpcProxy::segment(SRef<SolAR::datastructure::Image> const image, SRef<SolAR::datastructure::Image>& labelMap, std::vector<SolAR::datastructure::Rectanglei>& boxes, std::vector<std::pair<uint32_t,uint32_t>>& classObjectIds, std::vector<float>& scores)
46+
{
47+
::grpc::ClientContext context;
48+
::grpcIPanopticSegmentation::segmentRequest reqIn;
49+
::grpcIPanopticSegmentation::segmentResponse respOut;
50+
#ifndef DISABLE_GRPC_COMPRESSION
51+
xpcf::grpcCompressionInfos proxyCompressionInfo = xpcf::deduceClientCompressionInfo(m_serviceCompressionInfos, "segment", m_methodCompressionInfosMap);
52+
xpcf::grpcCompressType serverCompressionType = xpcf::prepareClientCompressionContext(context, proxyCompressionInfo);
53+
reqIn.set_grpcservercompressionformat (static_cast<int32_t>(serverCompressionType));
54+
#endif
55+
reqIn.set_image(xpcf::serialize<SRef<SolAR::datastructure::Image>>(image));
56+
reqIn.set_labelmap(xpcf::serialize<SRef<SolAR::datastructure::Image>>(labelMap));
57+
reqIn.set_boxes(xpcf::serialize<std::vector<SolAR::datastructure::Rectanglei>>(boxes));
58+
reqIn.set_classobjectids(xpcf::serialize<std::vector<std::pair<uint32_t,uint32_t>>>(classObjectIds));
59+
reqIn.set_scores(xpcf::serialize<std::vector<float>>(scores));
60+
#ifdef ENABLE_PROXY_TIMERS
61+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
62+
std::cout << "====> IPanopticSegmentation_grpcProxy::segment request sent at " << to_simple_string(start) << std::endl;
63+
#endif
64+
::grpc::Status grpcRemoteStatus = m_grpcStub->segment(&context, reqIn, &respOut);
65+
#ifdef ENABLE_PROXY_TIMERS
66+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
67+
std::cout << "====> IPanopticSegmentation_grpcProxy::segment response received at " << to_simple_string(end) << std::endl;
68+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
69+
#endif
70+
if (!grpcRemoteStatus.ok()) {
71+
std::cout << "segment rpc failed." << std::endl;
72+
throw xpcf::RemotingException("grpcIPanopticSegmentationService","segment",static_cast<uint32_t>(grpcRemoteStatus.error_code()));
73+
}
74+
75+
labelMap = xpcf::deserialize<SRef<SolAR::datastructure::Image>>(respOut.labelmap());
76+
boxes = xpcf::deserialize<std::vector<SolAR::datastructure::Rectanglei>>(respOut.boxes());
77+
classObjectIds = xpcf::deserialize<std::vector<std::pair<uint32_t,uint32_t>>>(respOut.classobjectids());
78+
scores = xpcf::deserialize<std::vector<float>>(respOut.scores());
79+
return static_cast<SolAR::FrameworkReturnCode>(respOut.xpcfgrpcreturnvalue());
80+
}
81+
82+
83+
}
84+

IPanopticSegmentation_grpcProxy.h

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// GRPC Proxy Class Header generated with xpcf_grpc_gen
2+
3+
4+
#ifndef IPANOPTICSEGMENTATION_GRPCPROXY_H
5+
#define IPANOPTICSEGMENTATION_GRPCPROXY_H
6+
#include "api/segm/IPanopticSegmentation.h"
7+
#include <xpcf/component/ConfigurableBase.h>
8+
#include <memory>
9+
#include <string>
10+
#include <map>
11+
#include "grpcIPanopticSegmentationService.grpc.pb.h"
12+
#include <grpc/grpc.h>
13+
#include <grpc++/channel.h>
14+
#include <xpcf/remoting/GrpcHelper.h>
15+
16+
namespace org::bcom::xpcf::grpc::proxyIPanopticSegmentation {
17+
18+
class IPanopticSegmentation_grpcProxy: public org::bcom::xpcf::ConfigurableBase, virtual public SolAR::api::segm::IPanopticSegmentation {
19+
public:
20+
IPanopticSegmentation_grpcProxy();
21+
~IPanopticSegmentation_grpcProxy() override = default;
22+
void unloadComponent () override final;
23+
org::bcom::xpcf::XPCFErrorCode onConfigured() override;
24+
25+
SolAR::FrameworkReturnCode segment(SRef<SolAR::datastructure::Image> const image, SRef<SolAR::datastructure::Image>& labelMap, std::vector<SolAR::datastructure::Rectanglei>& boxes, std::vector<std::pair<uint32_t,uint32_t>>& classObjectIds, std::vector<float>& scores) override;
26+
27+
28+
private:
29+
std::string m_channelUrl;
30+
uint32_t m_channelCredentials;
31+
std::shared_ptr<::grpc::Channel> m_channel;
32+
xpcf::grpcCompressionInfos m_serviceCompressionInfos;
33+
std::map<std::string, xpcf::grpcCompressionInfos> m_methodCompressionInfosMap;
34+
std::vector<std::string> m_grpcProxyCompressionConfig;
35+
std::unique_ptr<::grpcIPanopticSegmentation::grpcIPanopticSegmentationService::Stub> m_grpcStub;
36+
37+
};
38+
39+
}
40+
41+
42+
template <> struct org::bcom::xpcf::ComponentTraits<org::bcom::xpcf::grpc::proxyIPanopticSegmentation::IPanopticSegmentation_grpcProxy>
43+
{
44+
static constexpr const char * UUID = "26e61305-b483-487a-8701-4a9612af5db6";
45+
static constexpr const char * NAME = "IPanopticSegmentation_grpcProxy";
46+
static constexpr const char * DESCRIPTION = "IPanopticSegmentation_grpcProxy grpc client proxy component";
47+
};
48+
49+
50+
#endif

IPanopticSegmentation_grpcServer.cpp

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// GRPC Server Class implementation generated with xpcf_grpc_gen
2+
#include "IPanopticSegmentation_grpcServer.h"
3+
#include <cstddef>
4+
#include <boost/date_time.hpp>
5+
#include <xpcf/remoting/ISerializable.h>
6+
#include <xpcf/remoting/GrpcHelper.h>
7+
namespace xpcf = org::bcom::xpcf;
8+
9+
template<> org::bcom::xpcf::grpc::serverIPanopticSegmentation::IPanopticSegmentation_grpcServer* xpcf::ComponentFactory::createInstance<org::bcom::xpcf::grpc::serverIPanopticSegmentation::IPanopticSegmentation_grpcServer>();
10+
11+
namespace org::bcom::xpcf::grpc::serverIPanopticSegmentation {
12+
13+
IPanopticSegmentation_grpcServer::IPanopticSegmentation_grpcServer():xpcf::ConfigurableBase(xpcf::toMap<IPanopticSegmentation_grpcServer>())
14+
{
15+
declareInterface<xpcf::IGrpcService>(this);
16+
declareInjectable<SolAR::api::segm::IPanopticSegmentation>(m_grpcService.m_xpcfComponent);
17+
m_grpcServerCompressionConfig.resize(2);
18+
declarePropertySequence("grpc_compress_server", m_grpcServerCompressionConfig);
19+
}
20+
21+
22+
void IPanopticSegmentation_grpcServer::unloadComponent ()
23+
{
24+
delete this;
25+
return;
26+
}
27+
28+
29+
XPCFErrorCode IPanopticSegmentation_grpcServer::onConfigured()
30+
{
31+
for (auto & grpcCompressionLine : m_grpcServerCompressionConfig) {
32+
; translateServerConfiguration(grpcCompressionLine, m_grpcService.m_serviceCompressionInfos, m_grpcService.m_methodCompressionInfosMap);
33+
}
34+
return xpcf::XPCFErrorCode::_SUCCESS;
35+
}
36+
37+
38+
::grpc::Service * IPanopticSegmentation_grpcServer::getService()
39+
{
40+
return &m_grpcService;
41+
}
42+
43+
::grpc::Status IPanopticSegmentation_grpcServer::grpcIPanopticSegmentationServiceImpl::segment(::grpc::ServerContext* context, const ::grpcIPanopticSegmentation::segmentRequest* request, ::grpcIPanopticSegmentation::segmentResponse* response)
44+
{
45+
#ifndef DISABLE_GRPC_COMPRESSION
46+
xpcf::grpcCompressType askedCompressionType = static_cast<xpcf::grpcCompressType>(request->grpcservercompressionformat());
47+
xpcf::grpcServerCompressionInfos serverCompressInfo = xpcf::deduceServerCompressionType(askedCompressionType, m_serviceCompressionInfos, "segment", m_methodCompressionInfosMap);
48+
xpcf::prepareServerCompressionContext(context, serverCompressInfo);
49+
#endif
50+
#ifdef ENABLE_SERVER_TIMERS
51+
boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time();
52+
std::cout << "====> IPanopticSegmentation_grpcServer::segment request received at " << to_simple_string(start) << std::endl;
53+
#endif
54+
SRef<SolAR::datastructure::Image> image = xpcf::deserialize<SRef<SolAR::datastructure::Image>>(request->image());
55+
SRef<SolAR::datastructure::Image> labelMap = xpcf::deserialize<SRef<SolAR::datastructure::Image>>(request->labelmap());
56+
std::vector<SolAR::datastructure::Rectanglei> boxes = xpcf::deserialize<std::vector<SolAR::datastructure::Rectanglei>>(request->boxes());
57+
std::vector<std::pair<uint32_t,uint32_t>> classObjectIds = xpcf::deserialize<std::vector<std::pair<uint32_t,uint32_t>>>(request->classobjectids());
58+
std::vector<float> scores = xpcf::deserialize<std::vector<float>>(request->scores());
59+
SolAR::FrameworkReturnCode returnValue = m_xpcfComponent->segment(image, labelMap, boxes, classObjectIds, scores);
60+
response->set_labelmap(xpcf::serialize<SRef<SolAR::datastructure::Image>>(labelMap));
61+
response->set_boxes(xpcf::serialize<std::vector<SolAR::datastructure::Rectanglei>>(boxes));
62+
response->set_classobjectids(xpcf::serialize<std::vector<std::pair<uint32_t,uint32_t>>>(classObjectIds));
63+
response->set_scores(xpcf::serialize<std::vector<float>>(scores));
64+
response->set_xpcfgrpcreturnvalue(static_cast<int32_t>(returnValue));
65+
#ifdef ENABLE_SERVER_TIMERS
66+
boost::posix_time::ptime end = boost::posix_time::microsec_clock::universal_time();
67+
std::cout << "====> IPanopticSegmentation_grpcServer::segment response sent at " << to_simple_string(end) << std::endl;
68+
std::cout << " => elapsed time = " << ((end - start).total_microseconds() / 1000.00) << " ms" << std::endl;
69+
#endif
70+
return ::grpc::Status::OK;
71+
}
72+
73+
74+
}
75+

0 commit comments

Comments
 (0)