Release DetectVehicleIllegalParking DetectVehicleICongestion.

This commit is contained in:
sdk-team
2021-02-01 02:22:23 +00:00
parent 4b58532ad0
commit e0575e4c67
16 changed files with 971 additions and 0 deletions

View File

@@ -87,6 +87,42 @@ ObjectdetClient::ClassifyVehicleInsuranceOutcomeCallable ObjectdetClient::classi
return task->get_future();
}
ObjectdetClient::DetectIPCObjectOutcome ObjectdetClient::detectIPCObject(const DetectIPCObjectRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectIPCObjectOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectIPCObjectOutcome(DetectIPCObjectResult(outcome.result()));
else
return DetectIPCObjectOutcome(outcome.error());
}
void ObjectdetClient::detectIPCObjectAsync(const DetectIPCObjectRequest& request, const DetectIPCObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectIPCObject(request), context);
};
asyncExecute(new Runnable(fn));
}
ObjectdetClient::DetectIPCObjectOutcomeCallable ObjectdetClient::detectIPCObjectCallable(const DetectIPCObjectRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectIPCObjectOutcome()>>(
[this, request]()
{
return this->detectIPCObject(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ObjectdetClient::DetectMainBodyOutcome ObjectdetClient::detectMainBody(const DetectMainBodyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -231,6 +267,78 @@ ObjectdetClient::DetectVehicleOutcomeCallable ObjectdetClient::detectVehicleCall
return task->get_future();
}
ObjectdetClient::DetectVehicleICongestionOutcome ObjectdetClient::detectVehicleICongestion(const DetectVehicleICongestionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectVehicleICongestionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectVehicleICongestionOutcome(DetectVehicleICongestionResult(outcome.result()));
else
return DetectVehicleICongestionOutcome(outcome.error());
}
void ObjectdetClient::detectVehicleICongestionAsync(const DetectVehicleICongestionRequest& request, const DetectVehicleICongestionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectVehicleICongestion(request), context);
};
asyncExecute(new Runnable(fn));
}
ObjectdetClient::DetectVehicleICongestionOutcomeCallable ObjectdetClient::detectVehicleICongestionCallable(const DetectVehicleICongestionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectVehicleICongestionOutcome()>>(
[this, request]()
{
return this->detectVehicleICongestion(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ObjectdetClient::DetectVehicleIllegalParkingOutcome ObjectdetClient::detectVehicleIllegalParking(const DetectVehicleIllegalParkingRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DetectVehicleIllegalParkingOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DetectVehicleIllegalParkingOutcome(DetectVehicleIllegalParkingResult(outcome.result()));
else
return DetectVehicleIllegalParkingOutcome(outcome.error());
}
void ObjectdetClient::detectVehicleIllegalParkingAsync(const DetectVehicleIllegalParkingRequest& request, const DetectVehicleIllegalParkingAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, detectVehicleIllegalParking(request), context);
};
asyncExecute(new Runnable(fn));
}
ObjectdetClient::DetectVehicleIllegalParkingOutcomeCallable ObjectdetClient::detectVehicleIllegalParkingCallable(const DetectVehicleIllegalParkingRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DetectVehicleIllegalParkingOutcome()>>(
[this, request]()
{
return this->detectVehicleIllegalParking(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ObjectdetClient::DetectWhiteBaseImageOutcome ObjectdetClient::detectWhiteBaseImage(const DetectWhiteBaseImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectIPCObjectRequest.h>
using AlibabaCloud::Objectdet::Model::DetectIPCObjectRequest;
DetectIPCObjectRequest::DetectIPCObjectRequest() :
RpcServiceRequest("objectdet", "2019-12-30", "DetectIPCObject")
{
setMethod(HttpRequest::Method::Post);
}
DetectIPCObjectRequest::~DetectIPCObjectRequest()
{}
std::string DetectIPCObjectRequest::getImageURL()const
{
return imageURL_;
}
void DetectIPCObjectRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View File

@@ -0,0 +1,77 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectIPCObjectResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Objectdet;
using namespace AlibabaCloud::Objectdet::Model;
DetectIPCObjectResult::DetectIPCObjectResult() :
ServiceResult()
{}
DetectIPCObjectResult::DetectIPCObjectResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectIPCObjectResult::~DetectIPCObjectResult()
{}
void DetectIPCObjectResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["Score"].isNull())
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
if(!dataNodeElementsElement["Type"].isNull())
elementObject.type = dataNodeElementsElement["Type"].asString();
auto allBox = value["Box"]["Box"];
for (auto value : allBox)
elementObject.box.push_back(value.asString());
data_.elements.push_back(elementObject);
}
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string DetectIPCObjectResult::getMessage()const
{
return message_;
}
DetectIPCObjectResult::Data DetectIPCObjectResult::getData()const
{
return data_;
}
std::string DetectIPCObjectResult::getCode()const
{
return code_;
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectVehicleICongestionRequest.h>
using AlibabaCloud::Objectdet::Model::DetectVehicleICongestionRequest;
DetectVehicleICongestionRequest::DetectVehicleICongestionRequest() :
RpcServiceRequest("objectdet", "2019-12-30", "DetectVehicleICongestion")
{
setMethod(HttpRequest::Method::Post);
}
DetectVehicleICongestionRequest::~DetectVehicleICongestionRequest()
{}
Array DetectVehicleICongestionRequest::getRoadRegions()const
{
return roadRegions_;
}
void DetectVehicleICongestionRequest::setRoadRegions(const Array& roadRegions)
{
roadRegions_ = roadRegions;
setBodyParameter("RoadRegions", std::to_string(roadRegions));
}
Array DetectVehicleICongestionRequest::getPreRegionIntersectFeatures()const
{
return preRegionIntersectFeatures_;
}
void DetectVehicleICongestionRequest::setPreRegionIntersectFeatures(const Array& preRegionIntersectFeatures)
{
preRegionIntersectFeatures_ = preRegionIntersectFeatures;
setBodyParameter("PreRegionIntersectFeatures", std::to_string(preRegionIntersectFeatures));
}
std::string DetectVehicleICongestionRequest::getImageURL()const
{
return imageURL_;
}
void DetectVehicleICongestionRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View File

@@ -0,0 +1,115 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectVehicleICongestionResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Objectdet;
using namespace AlibabaCloud::Objectdet::Model;
DetectVehicleICongestionResult::DetectVehicleICongestionResult() :
ServiceResult()
{}
DetectVehicleICongestionResult::DetectVehicleICongestionResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectVehicleICongestionResult::~DetectVehicleICongestionResult()
{}
void DetectVehicleICongestionResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allRegionIntersectFeaturesNode = dataNode["RegionIntersectFeatures"]["RegionIntersectFeaturesItem"];
for (auto dataNodeRegionIntersectFeaturesRegionIntersectFeaturesItem : allRegionIntersectFeaturesNode)
{
Data::RegionIntersectFeaturesItem regionIntersectFeaturesItemObject;
auto allFeatures = value["Features"]["Features"];
for (auto value : allFeatures)
regionIntersectFeaturesItemObject.features.push_back(value.asString());
data_.regionIntersectFeatures.push_back(regionIntersectFeaturesItemObject);
}
auto allRegionIntersectsNode = dataNode["RegionIntersects"]["RegionIntersectsItem"];
for (auto dataNodeRegionIntersectsRegionIntersectsItem : allRegionIntersectsNode)
{
Data::RegionIntersectsItem regionIntersectsItemObject;
auto allIds = value["Ids"]["Ids"];
for (auto value : allIds)
regionIntersectsItemObject.ids.push_back(value.asString());
data_.regionIntersects.push_back(regionIntersectsItemObject);
}
auto allRegionIntersectMatchedNode = dataNode["RegionIntersectMatched"]["RegionIntersectMatchedItem"];
for (auto dataNodeRegionIntersectMatchedRegionIntersectMatchedItem : allRegionIntersectMatchedNode)
{
Data::RegionIntersectMatchedItem regionIntersectMatchedItemObject;
auto allIds1 = value["Ids"]["Ids"];
for (auto value : allIds1)
regionIntersectMatchedItemObject.ids1.push_back(value.asString());
data_.regionIntersectMatched.push_back(regionIntersectMatchedItemObject);
}
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["TypeName"].isNull())
elementObject.typeName = dataNodeElementsElement["TypeName"].asString();
if(!dataNodeElementsElement["Score"].isNull())
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
auto allBoxesNode = dataNodeElementsElement["Boxes"]["BoxesItem"];
for (auto dataNodeElementsElementBoxesBoxesItem : allBoxesNode)
{
Data::Element::BoxesItem boxesObject;
if(!dataNodeElementsElementBoxesBoxesItem["Left"].isNull())
boxesObject.left = std::stol(dataNodeElementsElementBoxesBoxesItem["Left"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Top"].isNull())
boxesObject.top = std::stol(dataNodeElementsElementBoxesBoxesItem["Top"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Right"].isNull())
boxesObject.right = std::stol(dataNodeElementsElementBoxesBoxesItem["Right"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Bottom"].isNull())
boxesObject.bottom = std::stol(dataNodeElementsElementBoxesBoxesItem["Bottom"].asString());
elementObject.boxes.push_back(boxesObject);
}
data_.elements.push_back(elementObject);
}
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string DetectVehicleICongestionResult::getMessage()const
{
return message_;
}
DetectVehicleICongestionResult::Data DetectVehicleICongestionResult::getData()const
{
return data_;
}
std::string DetectVehicleICongestionResult::getCode()const
{
return code_;
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectVehicleIllegalParkingRequest.h>
using AlibabaCloud::Objectdet::Model::DetectVehicleIllegalParkingRequest;
DetectVehicleIllegalParkingRequest::DetectVehicleIllegalParkingRequest() :
RpcServiceRequest("objectdet", "2019-12-30", "DetectVehicleIllegalParking")
{
setMethod(HttpRequest::Method::Post);
}
DetectVehicleIllegalParkingRequest::~DetectVehicleIllegalParkingRequest()
{}
Array DetectVehicleIllegalParkingRequest::getRoadRegions()const
{
return roadRegions_;
}
void DetectVehicleIllegalParkingRequest::setRoadRegions(const Array& roadRegions)
{
roadRegions_ = roadRegions;
setBodyParameter("RoadRegions", std::to_string(roadRegions));
}
std::string DetectVehicleIllegalParkingRequest::getImageURL()const
{
return imageURL_;
}
void DetectVehicleIllegalParkingRequest::setImageURL(const std::string& imageURL)
{
imageURL_ = imageURL;
setBodyParameter("ImageURL", imageURL);
}

View File

@@ -0,0 +1,97 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/objectdet/model/DetectVehicleIllegalParkingResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Objectdet;
using namespace AlibabaCloud::Objectdet::Model;
DetectVehicleIllegalParkingResult::DetectVehicleIllegalParkingResult() :
ServiceResult()
{}
DetectVehicleIllegalParkingResult::DetectVehicleIllegalParkingResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DetectVehicleIllegalParkingResult::~DetectVehicleIllegalParkingResult()
{}
void DetectVehicleIllegalParkingResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allRegionIntersectsNode = dataNode["RegionIntersects"]["RegionIntersect"];
for (auto dataNodeRegionIntersectsRegionIntersect : allRegionIntersectsNode)
{
Data::RegionIntersect regionIntersectObject;
auto allIds = value["Ids"]["Ids"];
for (auto value : allIds)
regionIntersectObject.ids.push_back(value.asString());
data_.regionIntersects.push_back(regionIntersectObject);
}
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!dataNodeElementsElement["TypeName"].isNull())
elementObject.typeName = dataNodeElementsElement["TypeName"].asString();
if(!dataNodeElementsElement["Score"].isNull())
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
auto allBoxesNode = dataNodeElementsElement["Boxes"]["BoxesItem"];
for (auto dataNodeElementsElementBoxesBoxesItem : allBoxesNode)
{
Data::Element::BoxesItem boxesObject;
if(!dataNodeElementsElementBoxesBoxesItem["Left"].isNull())
boxesObject.left = std::stol(dataNodeElementsElementBoxesBoxesItem["Left"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Top"].isNull())
boxesObject.top = std::stol(dataNodeElementsElementBoxesBoxesItem["Top"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Right"].isNull())
boxesObject.right = std::stol(dataNodeElementsElementBoxesBoxesItem["Right"].asString());
if(!dataNodeElementsElementBoxesBoxesItem["Bottom"].isNull())
boxesObject.bottom = std::stol(dataNodeElementsElementBoxesBoxesItem["Bottom"].asString());
elementObject.boxes.push_back(boxesObject);
}
data_.elements.push_back(elementObject);
}
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string DetectVehicleIllegalParkingResult::getMessage()const
{
return message_;
}
DetectVehicleIllegalParkingResult::Data DetectVehicleIllegalParkingResult::getData()const
{
return data_;
}
std::string DetectVehicleIllegalParkingResult::getCode()const
{
return code_;
}